Validating expression

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

Is it possible to validate a text box to ensure values entered are in the
format 99-99-99? All digits are required.

Thanks

Regards
 
Yes, use the RegularExpressionValidator and set hte ValidationExpression to
\d{2}\-\d{2}\-\d{2}

there's probably a more efficient way to write that... You'll also want to
put a requiredfieldvalidation to make sure atlast something is entered
(regularexpressionvalidator won't fire if the field is blank).

Karl
 

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

Back
Top