www.richandlucy.com © www.richandlucy.com
Home | Photos | Stuff | Forum

> Stuff > Lucy's Portfolio! > Javascript Example 10

Form Validation

Create an HTML form to sell any product you like. Ask for at least the following pieces of information:

  • Name
  • Address
  • City
  • Country
  • Email Address
  • Telephone Number
  • Job Title
  • Company Name
  • Type of company e.g. service, government, education, manufacturing, ..

Use Javascript validation when a button is pressed to validate as accurately as possible whether they have filled in the correct information. E.g. telephone number should contain only numbers and there should be the correct number of them and email addresses should have an @ symbol and a . symbol in them.

If they haven't, display an appropriate alert and move the focus to the appropriate input.

If all the inputs have been entered correctly, display the answers in a layer on the same page - or in another input box if you prefer.


You can see the page created here


2 3 4 5 6 7 8 9 10 11 12 13
© www.richandlucy.com - 2004 All content created and owned by www.richandlucy.com | Contact us