$(document).ready(function() { // Move btnsDiv to a better position (inside the field section) $("#genFileds").append($(".btnsDiv")); // Move mandatory red * to better position next to single upload file title (instead of next to chose file button) $('.fileUpload input').each(function() { if ($(this).attr('mandatory') === "1") { $(this).parent().siblings().first().prepend('*'); } }) // I think this is useless $('#blanket').before($('.formHeader')) // Move formHeader to inside of upperview for better positioning $('.upperView').prepend($('.formHeader')); // Remove useless attributes from signature canvas $("canvas.signatureClass").removeAttr("height") $(".SignatureCanvasClearButton").removeAttr('width'); // Add progress bar to top of fieldset $('fieldset').prepend('
') // Progress bar logic $('#genFileds').on('scroll', function() { const scrollableHeight = this.scrollHeight - this.clientHeight; const scrolled = this.scrollTop; const progress = (scrolled / scrollableHeight) * 100; $('.progress').css('width', progress + '%'); }); // In addition to the progress bar, scroll to top of each page when clicking on next / previous page button $("[class*='BTN']").each(function() { $(this).click(function() { $('#genFileds').scrollTop(0); $('.progress').css('width', '0'); }) }) })