Unobtrusive Validation Scripts Affecting Non-Umbraco Form
We have installed Umbraco Forms package. As a part of the install, we have added the script file references to the head of our Layout.cshtml file, as per this page:
The problem is, we have several forms that are not Umbraco Forms, that we use on the site, and we need to keep them as they are. But these forms have now stopped working. If I remove the script files, they start working again.
Is there some way of telling these forms to ignore the scripts? I'm hoping you're not going to tell me that using Umbraco Forms means that it's not possible to use standard forms.
Thanks for the info. Unfortunately it hasn't helped. FYI - the problem we are experiencing is that the unobtrusive validation scripts are causing all of our fields to be invalid, no idea why, so the server never gets hit.
Considering that Umbraco Forms is a package that requires payment for a license, I'd expect the online documentation to cover issues like this. Alas, it looks like we won't be able to use the Umbraco Forms package for our website and will have to code customer forms on an individual basis, by hand.
What does the html look like on your other forms? The only reference I could find for formnovalidate was with HTML5 validation rather than anything with unobtrusive client validation.
That was my understanding too. I could not see those attributes, and the HtmlHelper methods had no affect, but the form validation was obviously doing something, as when I removed the scripts the page worked as normal.
The lack of documentation from Microsoft (I couldn't find any) regarding unobtrusive validation is concerning. I could only find help regarding MVC3, and none of that was Microsoft documentation. Perhaps somethings changed in the version that Umbraco Forms requires.
Anyway, the novalidate attribute resolves the issue for now.
Unobtrusive Validation Scripts Affecting Non-Umbraco Form
We have installed Umbraco Forms package. As a part of the install, we have added the script file references to the head of our Layout.cshtml file, as per this page:
https://our.umbraco.org/documentation/products/umbracoforms/developer/Prepping-Frontend/
The problem is, we have several forms that are not Umbraco Forms, that we use on the site, and we need to keep them as they are. But these forms have now stopped working. If I remove the script files, they start working again.
Is there some way of telling these forms to ignore the scripts? I'm hoping you're not going to tell me that using Umbraco Forms means that it's not possible to use standard forms.
Thanks!
Any response on this? I'm ready to purchase the Umbraco Forms license once this issue is resolved.
Thanks!
Without knowing why your other forms stop working your mielage with this may vary be see this http://www.asp.net/mvc/overview/older-versions/creating-a-mvc-3-application-with-razor-and-unobtrusive-javascript. If you want to disable client side validation on some forms then within the view that hosts these forms you could place the html helpers and set values to false
Without knowing why your other forms stop working your mileage with this may vary but see this http://www.asp.net/mvc/overview/older-versions/creating-a-mvc-3-application-with-razor-and-unobtrusive-javascript. If you want to disable client side validation on some forms then within the view that hosts these forms you could place the html helpers and set values to false
Hi @Ian,
Thanks for the info. Unfortunately it hasn't helped. FYI - the problem we are experiencing is that the unobtrusive validation scripts are causing all of our fields to be invalid, no idea why, so the server never gets hit.
Considering that Umbraco Forms is a package that requires payment for a license, I'd expect the online documentation to cover issues like this. Alas, it looks like we won't be able to use the Umbraco Forms package for our website and will have to code customer forms on an individual basis, by hand.
It seems I've stumbled upon a workaround. I couldn't turn off the unobtrusive validation using the means described online, e.g. here.
But, when I added the
formnovalidate
attribute to the submit buttons within the form, client side validation stopped working!Might help someone at some point...
What does the html look like on your other forms? The only reference I could find for formnovalidate was with HTML5 validation rather than anything with unobtrusive client validation.
with these two lines in your view
do your form fields still have attributes which look like
As I understand it if these attributes are not anywhere in your form then client side validation should not kick in.
Hi @Ian
That was my understanding too. I could not see those attributes, and the HtmlHelper methods had no affect, but the form validation was obviously doing something, as when I removed the scripts the page worked as normal.
The lack of documentation from Microsoft (I couldn't find any) regarding unobtrusive validation is concerning. I could only find help regarding MVC3, and none of that was Microsoft documentation. Perhaps somethings changed in the version that Umbraco Forms requires.
Anyway, the
novalidate
attribute resolves the issue for now.is working on a reply...