Hi all,
I want to validate on the client side and I have the following php code (tbxBirthDate is the text box, ie name="tbxBirthD ate")
[code=php]
with(window.doc ument.enrollFor m)
{
.
$strBirthDate = tbxBirthDate;
$arr=split("/",$strBirthDate ); // splitting the array
$dd=$arr[0];
$mm=$arr[1];
$yy=$arr[2];
}
if(!checkdate($ mm,$dd,$yy))
{
alert("Please enter your birthdate in dd/mm/yyyy fomat");
cBirthDate.focu s();
return false;
}
[/code]
I keep getting the run time error "Error: Object expected" and I think it is the line $arr=split("/",$strBirthDate )
Can anyone see what the problem is?
Is this the best way to validate a date?
thanks
Denis
I want to validate on the client side and I have the following php code (tbxBirthDate is the text box, ie name="tbxBirthD ate")
[code=php]
with(window.doc ument.enrollFor m)
{
.
$strBirthDate = tbxBirthDate;
$arr=split("/",$strBirthDate ); // splitting the array
$dd=$arr[0];
$mm=$arr[1];
$yy=$arr[2];
}
if(!checkdate($ mm,$dd,$yy))
{
alert("Please enter your birthdate in dd/mm/yyyy fomat");
cBirthDate.focu s();
return false;
}
[/code]
I keep getting the run time error "Error: Object expected" and I think it is the line $arr=split("/",$strBirthDate )
Can anyone see what the problem is?
Is this the best way to validate a date?
thanks
Denis
Comment