ultraman
Well-known member
Hi ! Im using a CompareValidator to make sure that the text entered in a TextBox is a valid date.
Heres my simple code (In Page_Load) :
[VB]
cvDateDebut.ControlToValidate = "txtDateDebut"
cvDateDebut.Type = ValidationDataType.Date
cvDateDebut.Operator = ValidationCompareOperator.DataTypeCheck
cvDateDebut.ErrorMessage = "Not a valid date"
[/VB]
It works fine, but Id like it to be valid when theres "N/A" in the TextBox. Is there a way to do it other than with JavaScript ?
Heres my simple code (In Page_Load) :
[VB]
cvDateDebut.ControlToValidate = "txtDateDebut"
cvDateDebut.Type = ValidationDataType.Date
cvDateDebut.Operator = ValidationCompareOperator.DataTypeCheck
cvDateDebut.ErrorMessage = "Not a valid date"
[/VB]
It works fine, but Id like it to be valid when theres "N/A" in the TextBox. Is there a way to do it other than with JavaScript ?