469,900 Members | 1,485 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

How to prevent CompareValidator passing validation when input control is empty?

Hi,

I guess you all already know about the comparevalidator when the value of input control(ControlToValidate) is empty/null, it causes the validation success.

I know we can use requirefieldvalidator to make the field required on input control, but i don't want so. All I want to do is to compare value between two textboxs(Textbox1 and Textbox2) make sure it is the same. Textbox1 or Textbox2 can be empty. If both are empty or equal, it pass the validation else validatioin error.

Can anyone tell me of how to deal with this?

Thanks.
Sep 17 '08 #1
1 1785
PRR
750 Expert 512MB
Hi,

I guess you all already know about the comparevalidator when the value of input control(ControlToValidate) is empty/null, it causes the validation success.

I know we can use requirefieldvalidator to make the field required on input control, but i don't want so. All I want to do is to compare value between two textboxs(Textbox1 and Textbox2) make sure it is the same. Textbox1 or Textbox2 can be empty. If both are empty or equal, it pass the validation else validatioin error.

Can anyone tell me of how to deal with this?

Thanks.
i guess you cant.. you need a separate required field validator....
Sep 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Axel Dahmen | last post: by
2 posts views Thread by buran | last post: by
14 posts views Thread by Ed Jay | last post: by
1 post views Thread by R.A.M. | last post: by
7 posts views Thread by h7qvnk7q001 | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.