Remove HTML 5 Validation from webform element

Public

Warning message

We recommend you to assign at least one category to this snippet so you could easily navigate it in the future. Edit your snippet here.
</> CopyGet raw version
php
  1. function mymodule_form_alter(&$form,&$form_state,$form_id) {
  2.  
  3. if(strstr($form_id,'webform') !== FALSE) {
  4. // prevent html5 validation, i.e. on input type="email" fields
  5. form['#attributes']['novalidate'] = '1';
  6. }
  7.  
  8. }