Copied to clipboard

Flag this post as spam?

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


  • Paul Griffiths 355 posts 995 karma points
    Apr 05, 2018 @ 14:49
    Paul Griffiths
    0

    jQuery has not been loaded & is required for Umbraco Forms.

    Hi,

    I am fairly news to forms so may be missing something obvious. However, i am seeing the following error when placing my scripts and macro just before the closing body tag

    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.min.js"></script>
    <script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"></script>
    <script src="https://ajax.aspnetcdn.com/ajax/mvc/5.1/jquery.validate.unobtrusive.min.js"></script>
    @Umbraco.RenderMacro("FormsRenderScripts")
    

    enter image description here

    I have watched the umbraco forms videos and also been reading the documentation over at https://our.umbraco.org/Documentation/Add-ons/UmbracoForms/Developer/, in particular the Preparing your Frontend section and the 'extra step' (https://our.umbraco.org/Documentation/Add-ons/UmbracoForms/Developer/Rendering-Scripts/) but cant see what i am missing ?

    I understand the issue is that the form scripts are calling JQUERY before it is loaded in, hence the error. It seems like the error is being caused becuase the scripts are being called twice?

    enter image description here

    Umbraco version is 7.8 and form version is 6.0.7

    Thanks Paul

  • Paul Griffiths 355 posts 995 karma points
    Apr 05, 2018 @ 15:00
    Paul Griffiths
    100

    Just stumbled across https://our.umbraco.org/forum/umbraco-forms/85704-umbraco-forms-601-jquery-placement and following the answer works

    Go to -> Developers -> Partial View Macro Files -> InsertUmbracoFormWithTheme.cshtml -> at the end of this page you'll see something along the lines of:

       Html.RenderAction("RenderForm", "UmbracoForms", new {formId = form, recordId = recordGuid, theme = theme, includeScripts = includeScripts }); ‚Äč 
    
    change it to:
    
    Html.RenderAction("Render", "UmbracoForms", new {formId = form, mode = "form", recordId = recordGuid, theme = theme, includeScripts = includeScripts }); 
    

    i kept mode = "form" as the last param

    Seems to work!

    Paul

  • Rick Mason 38 posts 169 karma points
    Apr 18, 2019 @ 16:20
    Rick Mason
    0

    I just hit this issue and found that it was due to two copies of JQuery being loaded on the same page.

Please Sign in or register to post replies

Write your reply to:

Draft