diff options
author | kushalpandya <kushal@gitlab.com> | 2017-05-25 15:05:51 +0530 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-06-01 07:47:15 +0200 |
commit | 69c47658c7d21c577c6ce73806e62be9ff713084 (patch) | |
tree | 0a6bfd41995f8538e27843f4a0e24896423c8276 /app/assets | |
parent | c5e28a7b411fee60b9151f1477c420af46bcdf02 (diff) | |
download | gitlab-ce-69c47658c7d21c577c6ce73806e62be9ff713084.tar.gz |
Fix bug where form's `novalidate` attribute is not respected
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/gl_field_errors.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/assets/javascripts/gl_field_errors.js b/app/assets/javascripts/gl_field_errors.js index 4f226ff96ea..4bef60264bb 100644 --- a/app/assets/javascripts/gl_field_errors.js +++ b/app/assets/javascripts/gl_field_errors.js @@ -31,9 +31,13 @@ class GlFieldErrors { * and prevents disabling of invalid submit button by application.js */ catchInvalidFormSubmit (event) { - if (!event.currentTarget.checkValidity()) { - event.preventDefault(); - event.stopPropagation(); + const $form = $(event.currentTarget); + + if (!$form.attr('novalidate')) { + if (!event.currentTarget.checkValidity()) { + event.preventDefault(); + event.stopPropagation(); + } } } |