Regular Expression

G

Guest

I use the following code to get a valid date input.

validatorExpression = new RegularExpressionValidator();
validatorExpression.ControlToValidate = this.ID;
ValidatorExpression.ErrorMessage = "Valid Input mm/dd/yyyy";
validatorExpression.ValidationExpression = @"^\d{1,2}/\d{1,2}/\d{4}$";
validatorExpression.EnableClientScript = true;

The expression works fine, the problem I have is that when the field is
empty, it is asking the user for a date but one is not required.

How do I allow an empty value?

Thanks!

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top