EasyUI Forum
November 05, 2025, 05:13:10 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: Switchbutton with a textbox disabled  (Read 8295 times)
pixiesfr
Newbie
*
Posts: 3


View Profile Email
« on: May 09, 2016, 06:27:46 AM »

Hi to all.

I would like to have a switchbutton,with  when you push on it , it enable a switchbox, and when you uncheck, it disable the textbox.

Code Below...

I try on jsfiddle working fine with 1 switchbox.

But on my complete coden where I have 3 switchbox with 3 textbox , I have this error (all ID are different)
Code:
TypeError: _4dd is undefined
var opts=_4dd.options;

I dont know why i have this error .

When i remove this line
Code:
  $('#13T13').textbox('enable');
, if working for the 'else' part.

I

here the code that i used :

HTML :
Code:
 <td width="50">
        <span class="dsR44">
            <input class="easyui-switchbutton" name="SOFTWARE_12[value]" id="12I12">
        </span>
    </td>
    <td> <input value='' name="SOFTWARE_13[detail]" id='13T13' class='easyui-textbox' data-options="validType:'length[5,45]',required:'true',disabled:true," style="width:150px"></td>

JAvascript:
Code:
$(function(){ 
            var sw=$('#12I12').switchbutton({
                required:true,
                onText:'Oui',
                offText:'Non',
                value:'1',
                checked:'true',
                onChange: function(value){
                        if (value === true) {
                            $('#13T13').textbox('enable');
                        } else {
                        $('#13T13').textbox('disable');
                        }
                },
            })
        });
« Last Edit: May 09, 2016, 07:03:06 AM by pixiesfr » Logged
jarry
Administrator
Hero Member
*****
Posts: 2300


View Profile Email
« Reply #1 on: May 09, 2016, 08:24:19 AM »

Please look at this example http://code.reloado.com/ufesin4/edit#javascript,html. It works fine.
Logged
pixiesfr
Newbie
*
Posts: 3


View Profile Email
« Reply #2 on: May 09, 2016, 10:24:49 AM »

Hi,

Thanks for you answer, yes it working, but when i use it in my code , I have this error :

Code:
TypeError: _4dd is undefined
error source line:
var opts=_4dd.options;

The javascript is generated (PHP scripts) when a row is expanded from a datagrid.
Logged
pixiesfr
Newbie
*
Posts: 3


View Profile Email
« Reply #3 on: May 10, 2016, 12:26:37 AM »

Hi,

As the night give advice, i found that my issue is coming from the html received by onExpandRow that it's used to call the script.

Thank you.

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!