Don't know if you're still experience this issue but that happens because that macro - FormsRenderScripts - doesn't exist.
I believe the docs are a little bit outdated, but still, here is my solution:
1. Create a new Macro called, for example, "Forms Render Scripts" that uses the RenderUmbracoFormScripts view "~/Views/MacroPartials/RenderUmbracoFormScripts.cshtml"
2. In the file ~/Views/MacroPartials/InsertUmbracoFormWithTheme.cshtml update line 47 from
3. In the template where you are calling all your other scripts, add
@Umbraco.RenderMacro("FormsRenderScripts")
4. Remove any umbracoForms.js and other scripts calls from your theme's Script.cshtml
And that's about it.
As a side note, I've updated my jQuery Validate and jQuery Validate Unobtrusive to the latest version, so I could use my jQuery v3 and it's all working fine - apparently at least :)
I was having the exact issue described above i couldn't figure out how to integrate the differences in the latest version (7.6.11) to the version documented. It was the creation of the new macro referencing the existing Render UmbracoForm Scripts which was the missing part for me
@Pedro Mendes
When I follow this the form and form validation works, but my conditions doesn't apply. Do conditions work for you?
Seems like the macro RenderUmbracoFormScripts.cshtml loads a different set of script files, that looks to be deprecated.
If I insert a form using the InsertUmbracoFormWithTheme macro in a RTE, everything works perfect. However, if I call the macro manually from my template, I get the jQuery has not been loaded & is required for Umbraco Forms error, because I load my scripts before the body tag ends.
But why does it work with the macro in a RTE? 🤔
I've just had these issues, it's on a project I've inherited so no idea what the steps are to reproduce but it's with the DocTypeEditor, changing it so the scripts are output at the end and using a theme.
The above steps helped but the conditional logic on certain fields still didn't fire.
After following the fix in http://issues.umbraco.org/issue/CON-1463 to fix the radio box conditional issue I then found it still wasn't firing... I debugged it to this line:
var form = $('#umbraco_form_' + formId + ' .umbraco-forms-page');
In the Script.cshtml file - removing the .umbraco-forms-page class section meant it then found my form and started firing conditionals.
var form = $('#umbraco_form_' + formId);
I hope this helps someone else's sanity. I'd report the bug but I've no idea where to start. Has there just been a refactor of Umbraco Forms - this is pretty buggy stuff.
Forms Scripts Macro not rendering scripts
Hello all,
I'm trying to render form scripts using the following:
...but for some reason all that's being outputted is:
Any reason why this might be happening? I've followed the documentation (https://our.umbraco.org/documentation/Add-ons/umbracoforms/developer/rendering-scripts/) to a tee and also scoured the forums but still can't get it to work :/ Thanks in advance.
Hey there Myles,
Don't know if you're still experience this issue but that happens because that macro - FormsRenderScripts - doesn't exist.
I believe the docs are a little bit outdated, but still, here is my solution:
1. Create a new Macro called, for example, "Forms Render Scripts" that uses the RenderUmbracoFormScripts view
"~/Views/MacroPartials/RenderUmbracoFormScripts.cshtml"
2. In the file
~/Views/MacroPartials/InsertUmbracoFormWithTheme.cshtml
update line 47 fromto
3. In the template where you are calling all your other scripts, add
4. Remove any umbracoForms.js and other scripts calls from your theme's Script.cshtml
And that's about it.
As a side note, I've updated my jQuery Validate and jQuery Validate Unobtrusive to the latest version, so I could use my jQuery v3 and it's all working fine - apparently at least :)
Thanks for this Predo
I was having the exact issue described above i couldn't figure out how to integrate the differences in the latest version (7.6.11) to the version documented. It was the creation of the new macro referencing the existing Render UmbracoForm Scripts which was the missing part for me
Thanks
Thanks! This solved it for me too!
@Pedro Mendes When I follow this the form and form validation works, but my conditions doesn't apply. Do conditions work for you?
Seems like the macro
RenderUmbracoFormScripts.cshtml
loads a different set of script files, that looks to be deprecated.If I insert a form using the
InsertUmbracoFormWithTheme
macro in a RTE, everything works perfect. However, if I call the macro manually from my template, I get thejQuery has not been loaded & is required for Umbraco Forms
error, because I load my scripts before the body tag ends.But why does it work with the macro in a RTE? 🤔
Hey there OleP,
I've not tried conditions with the validation... I'll try to reproduce it and will get back to you when I'm able to :)
If you, eventually, figure this out, please share it :D
There's a section in the themes documentation on how to set it up properly: https://our.umbraco.com/documentation/Add-ons/UmbracoForms/Developer/Rendering-Scripts/
The docs are a bit confusing at the moment, since obsolete documentation is still present, like the one OP linked to.
EDIT: Documentation is now up to date
Hi,
I've just had these issues, it's on a project I've inherited so no idea what the steps are to reproduce but it's with the DocTypeEditor, changing it so the scripts are output at the end and using a theme.
The above steps helped but the conditional logic on certain fields still didn't fire.
After following the fix in http://issues.umbraco.org/issue/CON-1463 to fix the radio box conditional issue I then found it still wasn't firing... I debugged it to this line:
In the Script.cshtml file - removing the .umbraco-forms-page class section meant it then found my form and started firing conditionals.
I hope this helps someone else's sanity. I'd report the bug but I've no idea where to start. Has there just been a refactor of Umbraco Forms - this is pretty buggy stuff.
Steve
Here's how I solved it with Umbraco Forms 8.1.1. Just specify that exclude scripts should be false:
is working on a reply...