Full version: jsB@nk » Form » Disable Form Controls
URL: https://www.javascriptbank.com/disable-form-controls.html
Here's a simple form that contains a check box and a text box. Unless the check box is activated, you won't be able to enter anything into the text box.
Full version: jsB@nk » Form » Disable Form Controls
URL: https://www.javascriptbank.com/disable-form-controls.html
<SCRIPT LANGUAGE="JavaScript"><!-- Begin// Paul McFedries , http://www.mcfedries.com/function CheckCheckBox(frm) { if (!frm.CheckThis.checked) frm.CheckThis.focus() }// End --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<form><input type="CHECKBOX" name="CheckThis">To enter your name below, activate (check) this box.<p>Name: <input type="TEXT" name="UserName" onfocus="CheckCheckBox(this.form)"></form><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->