EasyUI Forum
September 13, 2025, 09:51:14 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: disable elemnts not working on validation  (Read 6139 times)
dj_niv
Newbie
*
Posts: 7


View Profile
« on: November 24, 2014, 12:14:50 AM »

Hello,

In form some elements are disable before submit although validation is not disabled on that element
I want to do disabled and enabled all form elements through jQuery or Javascript and stop validation for disabled dataslots.

Here I attached demo code for same.

Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 24, 2014, 07:34:39 AM »

You can disable the from validation before disabling or enabling some specified fields. After that enable the form validation again.
Code:
$('input:radio[name=demonstration]').change(function() {
//alert(this.value); 
$('#ff').form('disableValidation');
if(this.value=='No')
{
$('#uName1').prop('disabled', true);
$('#fSub').prop('disabled', true);
}
if(this.value=='yes')
{
$('#uName1').prop('disabled', false);
$('#fSub').prop('disabled', false);
}
$('#ff').form('enableValidation');
});
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!