Thursday, April 28, 2011

Image button causes validation

Problem/Challenge:
While creating my Contact form page I had several textboxes and a submit button all with various required entry validation assigned to them. This validation intended to prevent the submission of an incomplete form when clicking the submit button. The rest of the Contact page had additional buttons, represented on my master page, and when testing further realized these buttons when clicked from the Contact page, caused validation of the whole page to fire, preventing those buttons action from being executed due to the Contact form being incomplete.



Solution:
Button Property - CausesValidation ="False"

All of the other buttons on the page have a property, "Causes Validation" which is automatically set to "True", so when clicked they were firing the rest of the pages validation for the Contact form. Changing the property to "False" fixed the problem.

No comments:

Post a Comment