EasyUI Forum
May 16, 2024, 12:25:21 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: How to disable validatebox  (Read 20679 times)
entoknakal
Newbie
*
Posts: 6


View Profile
« on: May 21, 2014, 09:58:23 PM »

Hello,
I need to set validatebox to disable...Is this possible?
I am using easyui v1.3.6
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: May 21, 2014, 10:30:10 PM »

Please call 'disableValidation' method to disable validation.
Logged
entoknakal
Newbie
*
Posts: 6


View Profile
« Reply #2 on: May 21, 2014, 11:51:36 PM »

Hi Jarry,

Thank you..i mean is it posible if validatebox can disabled like numberbox using data options?
example:

Code:
<input type id="unitId" name="unit"></input>

<script type="text/javascript">
    $('#unitId').validatebox({
         disabled: true
    });
</script>
or
Code:
<input type id="unitId" name="unit" data-options="disabled:true"></input>

Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #3 on: May 22, 2014, 01:30:07 AM »

Yes, you can disable a input box.
Code:
<input type id="unitId" name="unit" disabled="disabled"></input>
A disabled input box has no validating actions on it but can't accept any entering chars. If you only want to disable the validation, set 'novalidate' property to true.
Code:
$('#unitId').validate({
  novalidate:true
});
« Last Edit: May 22, 2014, 01:32:19 AM by jarry » Logged
sky_proj
Newbie
*
Posts: 24


View Profile
« Reply #4 on: June 22, 2015, 09:43:37 PM »

<input type id="unitId" name="unit"></input>

<script type="text/javascript">
    $('#unitId').validatebox({
         disabled: true
    });
</script>

it's not work for me, im using easyui 1.4.2
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #5 on: June 22, 2015, 11:51:40 PM »

The 'disabled' property does not supported in the validatebox plugin, please use the 'novalidate' property instead.
Code:
$('#unitId').validatebox({
  novalidate:true
});
Logged
sky_proj
Newbie
*
Posts: 24


View Profile
« Reply #6 on: June 25, 2015, 02:31:48 AM »

The 'disabled' property does not supported in the validatebox plugin, please use the 'novalidate' property instead.
Code:
$('#unitId').validatebox({
  novalidate:true
});

i have try and still can not disabled..
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #7 on: June 25, 2015, 04:24:27 AM »

The novalidate property only disable the validating action, it can not disable the element.
Logged
sky_proj
Newbie
*
Posts: 24


View Profile
« Reply #8 on: June 25, 2015, 07:10:52 AM »

The novalidate property only disable the validating action, it can not disable the element.

Oh ok.. I'm find solution to disabled that element:
<script>
$(function(){
  $('#test).prop('disabled',true);
});
</script>

<html>
<input Id='test' class='easyui-validatebox'>
</html>
« Last Edit: June 25, 2015, 08:00:26 AM by sky_proj » 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!