Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

13. You always should try to make a good first impression.

Answered: 1 week ago