dhpotter
06-25-2003, 07:57 AM
Hi, I need to perform some form validation
ie make sure the fields dont contain spaces..
The following is the original script
function checkform(){
if (counter<5){
alert("Please choose the 4 bottles");
return false
}
else
return true;
}
this line creates the input box
<td ALIGN="right" height="46" width="259"><font color="#3366FF" face="Arial, Helvetica, sans-serif" size="4"> Name
:</font></td>
<td height="46" width="334"><input NAME="Name" SIZE="29"></td>
how do i reference the name box so that i can check it has a value.
i have tried the following
function checkform(){
if (counter<4){
alert("Please choose 4 bottles");
return false
if (this.form.Name ==""){
alert ("Please complete your personal details");
return false
}
else
return true;
}}
obviously I would need to check for all the fields , ie name, add, tel, email etc..
Can anyone help with the reference of the input box so I can check it..
any help would be great thanks
David
ie make sure the fields dont contain spaces..
The following is the original script
function checkform(){
if (counter<5){
alert("Please choose the 4 bottles");
return false
}
else
return true;
}
this line creates the input box
<td ALIGN="right" height="46" width="259"><font color="#3366FF" face="Arial, Helvetica, sans-serif" size="4"> Name
:</font></td>
<td height="46" width="334"><input NAME="Name" SIZE="29"></td>
how do i reference the name box so that i can check it has a value.
i have tried the following
function checkform(){
if (counter<4){
alert("Please choose 4 bottles");
return false
if (this.form.Name ==""){
alert ("Please complete your personal details");
return false
}
else
return true;
}}
obviously I would need to check for all the fields , ie name, add, tel, email etc..
Can anyone help with the reference of the input box so I can check it..
any help would be great thanks
David