Skip to main content
added 448 characters in body; added 1 character in body; added 154 characters in body
Source Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

InClient-side validation in this context means you let the browser check the validity of form elements. And every browser then comes with its own pop-ups you don't really have much control about. So, yeah, maybe you should get rid of this module first ^^ And then make use of Drupal's Form API and for example use #element_validate


I stumbled upon this post while looking for a way to disable client-side form validation in Drupal 8. My problem was when I use $form['#attributes']['novalidate'] = 'novalidate' (like suggested in on of the other answers) then the novalidate attribute gets added to the form wrapper instead of to the form itself. This doesn't prevent client-side validation. Form elements still validate in the browser.

Finally solved it by adding the following JS globally:

$('form').attr('novalidate', 'novalidate');

In Drupal 8 when I use $form['#attributes']['novalidate'] = 'novalidate' the novalidate attribute gets added to the form wrapper instead of to the form itself. This doesn't prevent client-side validation. Form elements still validate in the browser.

Finally solved it by adding the following JS globally:

$('form').attr('novalidate', 'novalidate');

Client-side validation in this context means you let the browser check the validity of form elements. And every browser then comes with its own pop-ups you don't really have much control about. So, yeah, maybe you should get rid of this module first ^^ And then make use of Drupal's Form API and for example use #element_validate


I stumbled upon this post while looking for a way to disable client-side form validation in Drupal 8. My problem was when I use $form['#attributes']['novalidate'] = 'novalidate' (like suggested in on of the other answers) then the novalidate attribute gets added to the form wrapper instead of to the form itself. This doesn't prevent client-side validation. Form elements still validate in the browser.

Finally solved it by adding the following JS globally:

$('form').attr('novalidate', 'novalidate');
Source Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

In Drupal 8 when I use $form['#attributes']['novalidate'] = 'novalidate' the novalidate attribute gets added to the form wrapper instead of to the form itself. This doesn't prevent client-side validation. Form elements still validate in the browser.

Finally solved it by adding the following JS globally:

$('form').attr('novalidate', 'novalidate');