469,572 Members | 1,281 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

RegularExpressionValidator - check for empty field

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.
Nov 17 '05 #1
1 4996
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
"Oleg Ogurok" <oo*****@thecramgroup.ihatespammers.ireallydo.co m> wrote in
message news:vf************@corp.supernews.com...
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.

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by DC | last post: by
3 posts views Thread by Andy Fish | last post: by
2 posts views Thread by Neil Zanella | last post: by
3 posts views Thread by tshad | last post: by
4 posts views Thread by =?Utf-8?B?Y3VyaW91cw==?= | last post: by
16 posts views Thread by mtuller | last post: by
3 posts views Thread by M. Ali Qureshi | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.