DEMO : Enable disable Checkbox by using buttons


PHP


Tutorial on Checkbox disable

Managing Checkboxes by Reading status and validating with option to enable or disable in a form

JavaScript

<SCRIPT LANGUAGE="JavaScript">
<!-- 	
function chk_control(str) {
if(str=='dsb'){document.getElementById('ck1').disabled=true;}
else {document.getElementById('ck1').disabled=false;}
}
//  End -->
</script>

HTML

<form name=form1 method=post action=check.php>
<table width=200  >

<tr  ><td ><input type=checkbox name=ckb id=ck1 value=1></td><td >PHP</td></tr>
<tr  ><td ><br><br><input type=button value='Disable' onClick="chk_control('dsb')";></td>
<td ><br><br><input type=button value='Enable' onClick="chk_control('enb')";></td></tr>
</table></form>

JavaScript Checkbox Reference
Subscribe to our YouTube Channel here



plus2net.com










We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer