Possible Duplicate:
use brackets in checkbox name when using php and javascript?
I use as name of input field in html code :
<input size="15" name="user[135][name]" value="" disabled=disabled>
then I want to work with it in javascript like this:
if(some_condition) { document.myform.user[135][name].disabled=false; }
But that doesn’t work, because of the brackets in field name. Is there any way how to solve it without changing html code?
Experience: if I use name as user_135_name all works perfectly.
thankx for help.
Maros
I’ll suggest add
idto your input tag as followsUsing simple Javascript
Using jQuery
Also if there is only one statement followed by
ifyou can omit{}Edited
Please save following code as a html file and see it should work for you