Jump to content

Enable button when checkbox is checked


houssam_ballout

Recommended Posts

<script type="text/javascript">/*<![CDATA[*//*---->*/function initthis(){document.getElementById("thissubmit").disabled=true;}function dis_enable_submit(){if(document.getElementById("thisckbox").checked == 1){document.getElementById("thissubmit").disabled=false;}else{document.getElementById("thissubmit").disabled=true;}}window.onload=initthis;/*--*//*]]>*/</script> <form><input type="checkbox" id="thisckbox" name="thisckbox" onclick="dis_enable_submit()" /><input type="submit" id="thissubmit" value="submit this" /></form>

Link to comment
Share on other sites

I'm sure your intentions are good, dsonesuk, but I don't think it's very helpful or conducive to learning when you just throw out a working script all the time. I think it'd be far more helpful to members here who are learning if they were given pointers in the right direction and let them try to write a script first.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...