Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Form Validation Fully...

 
Akshayan Venkatesh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am Useing Javascript to evaluate a form using follwing code ..In this Code is Checking Properly but..It Display One by one..

if(name.value.length==0){
alert("Please Enter Your First Name");}
if(password.value.length==0){
alert("Please Enter your Last Name");}
if(add.value.length==0){alert("Please Enetr Address") }

and another user details...etc

If You submit this it will alert me ...But I want the alert or msg the Group of null values.. If the User Does not Mention the one or more details alert msg will display ..this manner or any

The Folloeing details you did not Enter Please Enter the Details.
1.User Name
2.Pass word
3.Address..
Please tell me How Evaluate and Give the necessary Code...

Akshayan....
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a local string variable to store all messages and call alert() at the end.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic