Thursday, August 7, 2008
Email validations
function ValidateForm()
{
var emailID=document.frmSample.txtEmail
if ((emailID.value==null)||(emailID.value==""))
{
alert("Please Enter your Email ID") ;
emailID.focus();
return false ;
}
if (echeck(emailID.value)==false)
{
emailID.value="" ;
emailID.focus() ;
return false ;
}
return true
}
Labels:
Email validations
CHECK BOX Validations
function checkForm(){ errorMessage = false errorText = " " if (document.forms[0].Zip_Postalcode.value == "") { errorMessage = true errorText+="Zip Code n" } if (errorMessage ==true) { alert("Please make sure to fill out all required fields. Go back and check: " + errorText + "n" ") self.location="testjs2.php" return false } if (errorMessage==false) {return true}}
Labels:
CHECK BOX Validations
Date Validation
I was able to find a function on the web to only allow date entries in the format mm/dd/yyyy, the problem is it allows dates to be entered like this. 1/1/2005 when it should only allow 2 digits in the month and day area.
Help? (heres my code)
Help? (heres my code)
Labels:
Date Validation
Require field Validations
if(document.getElementById("txtdesctype").value.length==0 || document.getElementById("txtdesctype").value.charAt(0)==" ")
{
document.getElementById("txtdesctype").focus();
alert("Please Enter Payment Search Details");
document.getElementById("txtdesctype").value="";
return false ;
}
Labels:
Require field Validations
Subscribe to:
Posts (Atom)