Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

validate form

Status
Not open for further replies.

kharddie

Instructor
Feb 7, 2006
23
AU
i really dont know why this code cant just run .any help

function ValidateForm(){
var emailID=document.signup.email
var userID=document.signup.user
var given_nameID=document.signup.given_name
var sir_nameID=document.signup.sir_name
var countryID=document.signup.country
var state_city_townID=document.signup.state_city_town
var passID=document.signup.pass



if ((emailID.value==null)||(emailID.value=="")){
alert("Please Enter your Email ID")
emailID.focus()
return false
}

else if ((userID.value==null)||(userID.value=="")){ ){
alert("Please fill in the required fields")
userID.focus()
return false
}


else if((given_nameID.value==null)||(given_nameID.value=="")){ ){
alert("Please fill in the required fields")
given_nameID.focus()
return false
}

else if ((sir_nameID.value==null)||(sir_nameID.value=="")){ ){
alert("Please fill in the required fields")
emailID.focus()
return false
}
else if ((countryID.value==null)||(countryID.value=="") ){
alert("Please fill in the required fields")
emailID.focus()
return false
}
else if ((state_city_townID.value==null)||(state_city_townID.value=="")){ ){
alert("Please fill in the required fields")
emailID.focus()
return false
}
else if ((passID.value==null)||(passID.value=="")){ ){
alert("Please fill in the required fields")
emailID.focus()
return false
}

else{

if (echeck(emailID.value)==false){
emailID.value=""
emailID.focus()
return false
}
return true
}
}
</script>

thank you kharddie
 
It might have something to do with the erroneous syntax (extra brackets and braces that are appearing halfway across the page).

Try running it in Firefox and looking at the errors in the JavaScript console.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top