AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Web Development - Javascript - Valid Form

Javascript Valid Form



Current Version 1.3
Last Updated 19 Aug 2004

Useful form validation but without the annoying javascript alert box. If thats what you are after then you have came to the right place.

I really dislike alertbox validation - this one is bearable but this one just gets right up my nose :)

How much nicer is this

Name
Please enter your Name (a-z A-Z _ and space)
Email
Please enter a valid Email address

Much more user friendly I'm sure you'll agree. Check out a bigger demo here

Netscape error message Netscape 4x users will get the messages in a cutomisable error layer. like this. A lot more useful than an alert box and can be changed to fit in with the style of your site.

Not only does the form make sure that the fields have been filled in you can also validate the data that is entered. Validate the following data :

  • asc = a-z A-Z 0-9 _ and space
  • textonly = a-z A-Z - no spaces
  • email = valid email address
  • num = 0-9 and spaces
  • numonly = 0-9 no spaces
  • dateUK = date in the format dd/mm/yyyy
  • dateUS = date in the format mm/dd/yyyy

The script is a cross browser solution for validation the only compromise made was for Netscape 4x browsers that do not use the newer browser features. It has been tested in Internet Explorer - Netscape 6 - Opera - Mozilla all with the same appearance and functionality. Netscape 4x is identical in funtionality but only differs in appearance.

I will not go into great detail here as there are comments throughout the code. Apart from that it's not that difficult to set up (easier to do than explain)

Load the demo page and view the source
Or click here to see the source.
All you need is in the demo page source.

If you like this script or have suggestions etc then why not let us know in our Forum

Enjoy :)

Updated 19 Aug 2004







Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]