I've recently upgraded a site to Umbraco v7.6 with Umbraco Forms 6.0.1, and I'm now having issues with the form render scripts when there is more than one form on a page as it runs Script.cshtml for each form, resulting in multiple copies of the same script code that all execute when a form is submitted.
In the past, I've overcome this issue by simply extracting almost all the contents of Script.cshtml and inserting it into a JS file inside a jQuery each() function, and then including the Umbraco Forms JS files once. This is required for almost all my clients as there is typically a form on the page and then a form hidden away in a lightbox.
However, now that the scripts are generated dynamically, I'm not quite sure how to replicate this solution. Should I still be able to use the same scripts from version 4 and replace the class names? Will the issue of having multiple forms on a page be addressed any time soon?
Rendering multiple forms on one page
I've recently upgraded a site to Umbraco v7.6 with Umbraco Forms 6.0.1, and I'm now having issues with the form render scripts when there is more than one form on a page as it runs Script.cshtml for each form, resulting in multiple copies of the same script code that all execute when a form is submitted.
In the past, I've overcome this issue by simply extracting almost all the contents of Script.cshtml and inserting it into a JS file inside a jQuery each() function, and then including the Umbraco Forms JS files once. This is required for almost all my clients as there is typically a form on the page and then a form hidden away in a lightbox.
However, now that the scripts are generated dynamically, I'm not quite sure how to replicate this solution. Should I still be able to use the same scripts from version 4 and replace the class names? Will the issue of having multiple forms on a page be addressed any time soon?
is working on a reply...