Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disabling form elements with array names

Status
Not open for further replies.

mistergoomba

Programmer
Joined
Apr 10, 2006
Messages
9
Location
US
my form looks like this:

<select name="name[sel]">
<option value="other">OTHER</option>
<option value="martin">Martin</option>
</select>

<input type="text" name="name[txt]">

now when the user selects OTHER, it will disable the text input. changing the names of the variables is not an option, and using this.form.elements[1].disabled is not an option.

the question is, how do i reference name[txt] in javascript to disabled the field?!
 
>changing the names of the variables is not an option, and using this.form.elements[1].disabled is not an option.
>the question is, how do i reference name[txt] in javascript to disabled the field?!

Can javascript say no?
 
i have no idea what youre asking, but i figured out how to fix it. im using getelementbyid() and putting an id tag in the input field. thanks, buddy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top