Subject: Restricting Validator Controls
Posted By: Colonel Angus Post Date: 11/12/2004 1:30:08 PM
I have a web form with several validation controls on it.  When the submit button is clicked, the validators fire as expected.  However, I have another button on the form (to fill city and state info from a ZIP code) and when it is clicked, all the validators fire and don't allow the button's click event to fire.

Can I have validators fire only when a specific button is clicked?


Thanks in advance for your comments.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
Reply By: Colonel Angus Reply Date: 11/12/2004 3:30:04 PM
Well, I answered my own question.  If you're interested, here's what I found out.

1. I should set the button's CausesValidation property to False

2. I should check to make sure the forecolor of a textbox doesn't match the backcolor.

#1 prevents validators from firing

#2 effectively hides the text and makes the programmer feel like a dumba$$ when he figures this out.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.

Go to topic 22046

Return to index page 717
Return to index page 716
Return to index page 715
Return to index page 714
Return to index page 713
Return to index page 712
Return to index page 711
Return to index page 710
Return to index page 709
Return to index page 708