Copied to clipboard

Flag this post as spam?

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


  • vjaubin 3 posts 73 karma points
    Sep 29, 2017 @ 23:06
    vjaubin
    0

    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?

  • Richard Eyres 98 posts 580 karma points
    Oct 02, 2017 @ 09:21
    Richard Eyres
    0

    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

  • vjaubin 3 posts 73 karma points
    Oct 09, 2017 @ 14:47
    vjaubin
    0

    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:

    • jquery min 3.2.1
    • jquery validate 1.13.1
    • Unobtrusive 5.2.3

    Thanks, Vincent

  • Lewis Smith 208 posts 617 karma points c-trib
    Oct 09, 2017 @ 15:22
    Lewis Smith
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft