I have this HTML Code:
<input type="checkbox" onclick="document.getElementById('directory_entry_name').disabled=this.checked;" name="directory_entry" id="directory_entry" />
<strong>Name: </strong><input type="text" name="directory_entry_name" id="directory_entry_name" disabled="disabled" />
The text box is disabled and Im trying to make it so when the checkbox is checked it will enable the text box, and when it is unchecked again it will disable the text box.
It works if I use:
<input type="checkbox" onclick="document.getElementById('directory_entry_name').disabled=false;" name="directory_entry" id="directory_entry" />
But then when it is unchecked it doesnt re-disable the textbox.