EasyUI Forum
June 23, 2018, 12:56:11 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: "novalidate: true" for all form fields  (Read 57 times)
rezzonico
Full Member
***
Posts: 123


View Profile
« 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
« Last Edit: June 13, 2018, 07:36:24 AM by rezzonico » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3285


View Profile Email
« Reply #1 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.
Logged
rezzonico
Full Member
***
Posts: 123


View Profile
« Reply #2 on: June 14, 2018, 01:34:09 AM »

Thanks !

Miche
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!