2 Replies Latest reply on Aug 26, 2016 6:07 AM by Jason Hamilton

    Form validation

    Jason Hamilton

      Hey Sanford Whiteman

      This solution, http://codepen.io/figureone/pen/JKzjvE/?editors=0010 , works great! It is very extensible.

      If I wanted to add in the corporate email validation (ie no gmail, hotmail etc..) would I be able to work it in?

      I am struggling with the pattern, can I include a series of strings?  Maybe I am trying to put square peg in a round hole

      field: 'Email',

      pattern: /[0-9]/,

      predicate: false,

      message: 'Must use a corporate email address',

       

      Any help would be greatly appreciated!

       

      Thanks,

      Jason

        • Re: Form validation
          Sanford Whiteman
             {
              field: 'Email',
              pattern: /@(gmail.com|yahoo.com|hotmail.com)$/,
              predicate: false,
              message: 'Must use a corporate email address'
              }
          

           

          But the list of freemail domains is actually gigantic, so unless you want only the low-hanging fruit, building the pattern inline is going to get really long. In my demo here I show how to save the whole Freemail list separately to your instance, then validate against it.  I haven't combined that with my extensible "validation framework" yet.

          1 of 1 people found this helpful