SOLVED

Re: Form validation

Go to solution
Jason_Hamilton1
Level 8 - Champion Alumni

Form validation

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

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Form validation

   {

    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.

View solution in original post

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Form validation

   {

    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.

Jason_Hamilton1
Level 8 - Champion Alumni

Re: Form validation

Sanford Whiteman​ Thank you so much!! It works perfect.  You have helped me so much with my technical questions and I truly do appreciate it!

Thanks,

Jason