Forum Moderators: open
PHP:
<input TYPE=text name='itemid[1]' value='1' size=30 disabled>
<input TYPE=checkbox name="aktywny[]" value="1">
<input TYPE=text name='itemid[2]' value='2' size=30 disabled>
<input TYPE=checkbox name="aktywny[]" value="2">
<input TYPE=text name='itemid[3]' value='3' size=30 disabled>
<input TYPE=checkbox name="aktywny[]" value="3">
etc ...
Now I need to add onclick method to the checkbox that will ENABLE/distable the apropriate text field. I mean
checkbox that has value "1" enables/disables the text field which has the "1" VALUE.
Any ideas?
I have tried something like this :
<form ACTION="" name=test>
<input TYPE="abc[123a]" value='aaa' disabled> <input TYPE="checkbox" onclick="document.test.abc['123a'].enabled">
</FORM>
But it doesn't work :(
You're on the right track. However, instead of:
onclick="document.test.abc['123a'].enabled"
...you want to do:
onclick="document.test.abc['123a'].disabled=false"
If you later need to disable a field again...
document.test.abc['123a'].disabled=true