EasyUI Forum

General Category => General Discussion => Topic started by: mendozada on February 15, 2016, 04:33:17 AM



Title: switchbutton with a textbox.
Post by: mendozada 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.


Title: Re: switchbutton with a textbox.
Post by: stworthy 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>


Title: Re: switchbutton with a textbox.
Post by: mendozada on February 16, 2016, 04:18:17 AM
it's perfect , very thanks