Hi
Is it possible to have a html text field disabled if or if not a checkbox is checked, without having to submit a post and reload the whole page? If it's possible I would like to know how.
tores
Disable a textfield when a checkbox is checked
Moderator: General Moderators
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
You could use javascript.
Code: Select all
<input type="checkbox" name="is_new" value="1" onclick="
bVal=!this.checked;
topic_name.disabled=bVal;
if(!bVal)topic_name.focus()
" checked>
<input type="text" name="topic_name">