I have a submit button on my MVC form (with unobtrusive validation enabled) which has the cancel class:
<input type="submit" name="Go back" value="1" class="cancel" />
The cancel
class allows the form to POST even if input fields have validation errors. But the validation error messages are nonetheless displayed as soon as the button is clicked, and remain visible until the server completes the round trip and the page is redisplayed.
Is there something baked into MVC that I'm missing, or do I need to write my own JS code to find and hide all validation messages if the submit element has the "cancel" class?