Validate Email field

anupchandran
Kilo Contributor

Need a validation scripts to validate Email field. Field should validate (@ and .)

if somebody attempts to enter the email address without @ and .

1 ACCEPTED SOLUTION

Mike Allen
Mega Sage

There is a built in method:



if(oldValue != newValue){


  g_form.hideFieldMsg('email', true);


  if (!isEmailValid(newValue)) {


            g_form.showFieldMsg('email', newValue + " is an invalid email, please re-enter email in correct format.",'error');


  }


}


Capture.PNG


View solution in original post

10 REPLIES 10

Mike Allen
Mega Sage

There is a built in method:



if(oldValue != newValue){


  g_form.hideFieldMsg('email', true);


  if (!isEmailValid(newValue)) {


            g_form.showFieldMsg('email', newValue + " is an invalid email, please re-enter email in correct format.",'error');


  }


}


Capture.PNG


Hi Mike,



Thank you so much for your response.



Thanks and Regards


Anup


Hey Mike,



It is useful but the thing is it shouldnot trigger the mail also o the provided wrong mail id,but in your case it is not happening.


Also i want @project.com validation in the above script,can that happen?



Kindly help