Demo of Desable & enable method of checkboxradio





Click the button to change the method of the checkboxradio ( disable or enable ) .

HTML

<input type=text name=t1 id=my_checkboxradio class='form-control' 
 placeholder='Bring Mouse here' title='This is title of input box'>

jquery

<script>
$(document).ready(function() {	
/////////
$( "#my_checkboxradio" ).checkboxradio({
});
///////
$('#b1').click(function(){
var str=$(this).attr("value");
$( "#my_checkboxradio" ).checkboxradio(str);

if(str=='disable'){
$("#b1").prop('value', 'enable');	
$("#b1").html(' Enable ');
$('#b1').removeClass( 'btn btn-danger ').addClass( 'btn btn-success ' );
}
if(str=='enable'){
$("#b1").prop('value', 'disable');	
$("#b1").html('Disable');
$('#b1').removeClass('btn btn-success ').addClass( 'btn btn-danger ' );
}
})
///
})
</script>