0
votes

I have a situation where I have a form that has some validation controls for required fields. They fire just fine if the user does not have the required fields.

The thing is I also have a menu above the form which allows the user to select another location which is then reflected on the form.

This is where I run into an issue...

If the user already selected a location and then wishes to change to a different location, the form does not allow for this as required fields have not been entered.

I was wondering if there is a way to tell the validation controls not to fire in these situation.

My other option would be to do a validation on click of the submit button in which case I would not be able to take advantage of the ASP.NET required validation control.

Basically I want the validation to occur for the required fields only if the submit button is clicked.

2

2 Answers

0
votes

On the menu item set CausesValidation to false.

You can also use validation groups and set the validationgroup property of the validator and the submit button to the same value.

0
votes

Look at CausesValidation and ValidationGroup properties. I think they will help you to solve your problem