Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Robert Gillman 7 posts 78 karma points
    Jun 14, 2017 @ 07:13
    Robert Gillman
    1

    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?

Please Sign in or register to post replies

Write your reply to:

Draft