Question
I need help with my javascript code to validate email input on my form please. My HTML form: E-mail: Submit Clear Heres the javascript code
I need help with my javascript code to validate email input on my form please.
My HTML form:
Heres the javascript code I have so far:
//validate e-mail function validEmail(email) { var re =/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email);}
Please make sure it is validated with javascript code and not done with HTML. Thanks!
1) Pass it a string that may or may not contain a valid email address,and it will return true (it is an email) or false (it is not an email).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started