0

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?

1
  • each of the buttons have different validation or one need to validate and the second don't? Commented Jul 16, 2014 at 4:34

1 Answer 1

1

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 HTML validation for one of the 2 button with the formnovalidate attribute:

<asp:button id="button" runat="server" text="submit" formnovalidate="formnovalidate"  />

or you should create some custom JavaScript:

How can I void a form action and execute jQuery when all HTML form elements are validated?

How to force an HTML form to validate without submitting it via jQuery

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.