I have been playing with this::::::::::::::
'Check the date of birth is a date before entering it
If Request.Form("DOBday") <> 0 AND Request.Form("DOBmonth") <> 0 AND Request.Form("DOByear") <> 0 Then
dtmDateOfBirth = internationalDateTime(DateSerial(Request.Form("DOByear"), Request.Form("DOBmonth"), Request.Form("DOBday")))
End If
and the form validation in the register.asp but cant find a way to
make it not submit if the age value is under say 18
Could it be some thing like:::::::::::::
'Check the date of birth is a date before entering it
Dim intAge, AstDateOfBirth
If Request.Form("DOBday") = 0 AND Request.Form("DOBmonth") = 0 AND Request.Form("DOByear") = 0 Then
' exit and give error msg
AstDateOfBirth = '' Return user to correct ? msg to say dob required
Else
if Request.Form("DOBday") > 0 AND Request.Form("DOBmonth") > 0 AND Request.Form("DOByear") > 0 Then
AstDateOfBirth = internationalDateTime(DateSerial(Request.Form("DOByear"), Request.Form("DOBmonth"), Request.Form("DOBday")))
'''' check here if the age is over 18 if not then exit and give error
intAge = Fix(DateDiff("m", AstDateOfBirth, now())/12)
If intAge < 18 then
'' Return user to correct ?
Else
dtmDateOfBirth = intAge
End if
End If
End If
Edited by thepolecat - 12 December 2006 at 10:57am