RequiredFieldValidator fired when no validation needed

V

Vik

In VS 2005, on a page there is a dropdownlist and a RequiredFieldValidator
for that list. There are also two buttons - an "Add" button with
CausesValidation = True and a "Search" button with CausesValidation = False.

The first value in the dropdownlist is Null. If I select some value in the
DDL and then select Null in this list, then the RequiredFieldValidator
immidiately displays a message though no button was clicked and no
validation should be done at this time. If I click the Search button, the
validator disappears and search is executed.

How can I make the validator to fire only when the page is submitted (that
was a behavior in VS 2003)?

Thanks.
 
S

Scott M.

Validators have always triggered their validation when you either submit the
form or the control to validate loses its focus. This is not new behavior
(it worked like this in VS 2003).

If you don't want the validation when the control loses the focus, you'll
have to write your own validator.

-Scott
 

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

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top