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

Something is wrong 1
Need help with this script 4
Mini Web Server in C++ (Part One) 4
validation expression 2
Regular Expression Help please 6
Collect Excel Data from Website 5
Invisible folder 0
Google sheets 0

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top