View Full Version : Length Property/Function in JavaScript

07-03-2012, 02:03 PM
Hi Guys,

I'm very new to JavaScript. I need help with the following exercise relating to length property and email validation.

"Create a form and add validation for three fields such as name (must enter at least five characters), Zip (must have number only and must be five digits) and Email-must be valid email".

Thank you


Philip M
07-03-2012, 02:13 PM
This forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others (especially code that appears to be for homework), but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.

Form validation (including email) has been covered a zillion times in this forum. Remember that a proper name may only contain letters, hyphen, space and apostrophe (and not any five+ characters). So the length property is not very useful here.

Google for "Javascript regular expressions".

It is your responsibility to die() if necessary….. - PHP Manual