EasyUI Forum
May 15, 2024, 11:52:29 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.  (Read 5936 times)
mendozada
Newbie
*
Posts: 9


View Profile
« on: February 15, 2016, 04:33:17 AM »

Hello, would need an example of how to relate a switchbutton with a textbox, if the state is YES so that the textbox is shown as it is not, it is hidden.
Thank you.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 16, 2016, 01:26:04 AM »

Please refer to the following code:
Code:
<input id="sb" checked>
<div id="cc">
<input id="tt" class="easyui-textbox">
</div>
<script type="text/javascript">
$(function(){
$('#sb').switchbutton({
onChange: function(checked){
if (checked){
$('#cc').show();
} else {
$('#cc').hide();
}
}
})
})
</script>
Logged
mendozada
Newbie
*
Posts: 9


View Profile
« Reply #2 on: February 16, 2016, 04:18:17 AM »

it's perfect , very thanks
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!