5

For some reason, Chrome seems to validate the required fields even when the submit button has got the attribute formnovalidate.

See http://jsfiddle.net/4LA9e/

<form>
  Required field: <input type="text" required />
  <input type="submit" formnovalidate value="do not validate" />
</form>

Clicking the "do not validate" button still validates the text field (tested on Chrome 30.0.1599.69 m).

Is there anything I am doing wrong? Is that a bug? Any workaround?

Gyum Fox
  • 3,287
  • 2
  • 41
  • 71
  • Seems to be a bug. Had Chrome 29.something before, could not reproduce with your fiddle. Now updated to same version you are using, and there I can see it happening. – CBroe Oct 08 '13 at 14:30
  • 1
    Might be this: https://code.google.com/p/chromium/issues/detail?id=303707 – Gyum Fox Oct 08 '13 at 15:26
  • Sam for me, any fix loease ? – Milos Cuculovic Oct 17 '13 at 08:39
  • Looks like version 31.0.1650.57 m fixes the problem – Gyum Fox Nov 26 '13 at 17:23
  • @GyumFox, Nope, I'm still getting this error. I know that `novalidate` works on the `form` element, but is `formnovalidate` even a valid attribute on the **`input`** element? – Pacerier Jan 27 '15 at 06:42
  • @Pacerier, I'm no longer having the issue with Chrome. Yes you may use this attribute on a submit button (see http://www.w3.org/TR/html5/forms.html#attr-fs-formnovalidate). Eg: when implementing a cancel button, you do not need to content to be validated before submitting the form. If you are still experiencing the issue, feel free to update the Chromium bug (see link above) or post your question. – Gyum Fox Jan 28 '15 at 08:26
  • 1
    @GyumFox I am using this attribute on a submit button on an HTTP GET form, and I am having the issue on both Chrome and IE 11... – Dylan Czenski Jul 14 '16 at 20:49

1 Answers1

1

As mentioned in my comment on the question, this was a regression introduced in version 30 (see this bug report), which was then fixed in Chrome 31.

Gyum Fox
  • 3,287
  • 2
  • 41
  • 71