I have a webpage with some textboxes and drop down lists. I have already validated to make sure that something is selected, now i want to make sure that the start date is not greater than the end date. this is the code i have for that function
in that function, the start date and end date validation is not working at all. how do i make this work?
Code:
Private Function ValidInput() As Boolean
Dim arTextBoxes() As TextBox = {
tbShipper,
tbConsignee,
tbEnterStrtEntDate,
tbEnterEndShipDate,
tbEnterStrtShipDate,
tbEnterEndEntDate,
tbProNumber,
tbBillOfLadingNumber,
tbCheckNumber,
tbInvoiceNo
}
For Each tb In arTextBoxes
tb.Text = Trim(tb.Text)
If tb.Text.Length > 0 Then
Return True
End If
Next
'if we made it here, then none of the tbs are filled in.
If ddlScacs.SelectedIndex <> 0 Then
Return True
End If
If ddlLocation.SelectedIndex <> 0 Then
Return True
End If
If (tbEnterStrtShipDate.Text > tbEnterEndShipDate.Text) Then
FBErrMess.Visible = True
FBErrMess.Text = "Start date cannot come after end date."
End If
'so at this point, no tbs, no ddls used, yell at them.
_dbmanager.ClearData()
RefreshPagers()
FBErrMess.Text = "Please enter search criteria before searching."
FBErrMess.Visible = True
Return False
End Function
Comment