Hi,
I got a asp page where I am trying to do validation of fields using VBSSCRIPT. In one of the validation I need to compare date field. The date field is captured as month, day and year (mm, dd, yy) where each of this entity is entered in separate text box.
There is a date named quarter date. The following is the code for validation. However, it is not working. I would like to know what is the problem in the following. Thanks.
<script LANGUAGE="VBScript">
Function frm_Details_OnSubmit
validation = true
If (frm_Details.ClaimNo_0.value = "") Then
Alert("You must enter a value for Claim number.")
frm_Details.ClaimNo_0.focus
frm_Details_OnSubmit =False
ELSEIf DateValue((document.frm_Details.ExpMonth_0.value) & "/" & (document.frm_Details.ExpDay_0.value) & "/" & (frm_Details.ExpYear_0.value)) > DateValue("(Session("QuarterEndDate"))") Then
Alert("You must enter claim date within the End Quarter Date")
document.frm_Details.ExpMonth_0.focus
frm_Details_OnSubmit =False
Else
frm_Details_OnSubmit = True
End If
End Function
</script>
I got a asp page where I am trying to do validation of fields using VBSSCRIPT. In one of the validation I need to compare date field. The date field is captured as month, day and year (mm, dd, yy) where each of this entity is entered in separate text box.
There is a date named quarter date. The following is the code for validation. However, it is not working. I would like to know what is the problem in the following. Thanks.
<script LANGUAGE="VBScript">
Function frm_Details_OnSubmit
validation = true
If (frm_Details.ClaimNo_0.value = "") Then
Alert("You must enter a value for Claim number.")
frm_Details.ClaimNo_0.focus
frm_Details_OnSubmit =False
ELSEIf DateValue((document.frm_Details.ExpMonth_0.value) & "/" & (document.frm_Details.ExpDay_0.value) & "/" & (frm_Details.ExpYear_0.value)) > DateValue("(Session("QuarterEndDate"))") Then
Alert("You must enter claim date within the End Quarter Date")
document.frm_Details.ExpMonth_0.focus
frm_Details_OnSubmit =False
Else
frm_Details_OnSubmit = True
End If
End Function
</script>