I have a web form with several fields and two buttons. All fields are require validation.
How can I group the fields with html5 required attribute based on each of the individual buttons, like validation groups?
I have a web form with several fields and two buttons. All fields are require validation.
How can I group the fields with html5 required attribute based on each of the individual buttons, like validation groups?
Sadly there is no way..
Asp.net has the "only one big form approach" and html5 validation is tied to the form.
The only workaround is to disable html5 validation for one of the 2 button with formnovalidate attribute:
<asp:button id="button" runat="server" text="submit" formnovalidate="formnovalidate" />
or you should create some custom javascript:
How to force a html5 form validation without submitting it via jQuery