I am looking for a way to prevent the page from refreshing if the validation fails, for instance a wrong email format. The page does not refresh if a field is required and left empty which is just the way I want it.
Another way would be to use a plugin such as JQuery Validate. This would simply check if the email address was valid before letting the form submit. Although its best to have both front end and back end validation, this would be a quick win.
Umbraco form validation refresh page
Hi,
I am looking for a way to prevent the page from refreshing if the validation fails, for instance a wrong email format. The page does not refresh if a field is required and left empty which is just the way I want it.
Is it possible?
Hello
I would recommend reading the documentation for Forms. https://our.umbraco.org/documentation/Add-ons/UmbracoForms/Developer/Prepping-Frontend/
Essentially, you will need to set up the Unobtrusive scripts.
Hope that points you in the right direction.
Regards
Thanks for the reply Richard. Sorry I have not replied sooner. I was on jury duty.
I did set up the Unobtrusive scripts.
I have Umbraco version 7.7.1 installed so I am not sure the following versions are correct:
Thanks, Vincent
Hi,
Another way would be to use a plugin such as JQuery Validate. This would simply check if the email address was valid before letting the form submit. Although its best to have both front end and back end validation, this would be a quick win.
https://jqueryvalidation.org/ is the package.
You simply include the code with your normal script after JQuery has been included. Then put which fields you require and call the plugin.
The documentation is also really good.
Thanks, Lewis
is working on a reply...