Copied to clipboard

Flag this post as spam?

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


  • Albion 7 posts 77 karma points
    Oct 11, 2020 @ 15:17
    Albion
    0

    Umbraco Forms add custom validation

    Hi

    We have set up a Umbraco form and would like to use Umbraco to compare the two email addresses (Customer email and Customer confirm email field) and signal if the second one is different from the first one.

    What’s the best approach for it?

    Thanks

  • Liam Dilley 95 posts 242 karma points
    Oct 12, 2020 @ 00:38
    Liam Dilley
    0

    Without going hard into custom validation and backend code most sites just do Javascript based solutions so you can be more dynamic.

    It all depends on your code setup and what Javascript framework you use but on the most basic level your code is..

        if (document.getElementById('email1').value != document.getElementById('email2').value)
    
    {       
        alert('Those emails don\'t match!');
                 return false;
             }
            else {
                 return true;
        }
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies