EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: rezzonico on June 13, 2018, 07:27:54 AM



Title: "novalidate: true" for all form fields
Post by: rezzonico on June 13, 2018, 07:27:54 AM
Hi all,

I have a form (fm1) and within the form I have another form (fm2).
During the "onSubmit" I want to set "novalidate: true" for all the fields inside "fm2".
I know how to set "novalidate: true" for a single field (see code below) but how is it possible to set "novalidate: true" for all the fields inside "fm2" ?

Code:
$('#fm1').form('submit', {
   onSubmit: function() {
      $('#Description').validatebox({
         novalidate: true
      });

      var isValid = $(this).form('validate');
   }
});

<form id="fm1" method="post" novalidate>
   <form id="fm2" method="post" novalidate>
   </form>
</form>

Regards
Miche


Title: Re: "novalidate: true" for all form fields
Post by: stworthy on June 13, 2018, 06:10:12 PM
You should assign the 'easyui-form' class to the form element and set the 'novalidate' property to true.
Code:
<form id="fm1" class="easyui-form" method="post" data-options="novalidate:true">
...
</form>

You also can call 'disableValidation' or 'enableValidation' methods on a form to disable or enable it.


Title: Re: "novalidate: true" for all form fields
Post by: rezzonico on June 14, 2018, 01:34:09 AM
Thanks !

Miche