RegularExpressionValidator - check for empty field

  • Thread starter Thread starter Oleg Ogurok
  • Start date Start date
O

Oleg Ogurok

Hi all,

I want to use RegularExpressionValidator to enforce non-empty integer format
in a TextBox. However, the validator doesn't give the error when the textbox
is empty. For example, if ValidationExpression is \d+ or even \d{1,}, the
validator still allows empty field. Must I use an additional
RequiredFieldValidator?

-Oleg.
 
If a field is empty every validator (except RequiredFieldValidator) will not
be called.

If a field is required AND has an expected format, you will have to include
2 validators.

Or you can look at writing your own composite control that has both
validators inside it.

bill
 
Back
Top