Click to See Complete Forum and Search --> : acitvate radiobutton at text-insert...


hposedu
12-05-2002, 02:27 AM
hi!

i have some textfields with a radiobutton for each before it.
now i want, that if i insert something in one of the textfields, that automaticly the radiobutton of this textfild is activated. how can i do this

thx for helping

Rick Bull
12-05-2002, 05:45 AM
You could try something like this:


<form action="#"><p>
<input type="radio" name="rdo1" /><input type="text" name="txt1" onchange="this.form.rdo1[0].checked = true;" />
<input type="radio" name="rdo1" /><input type="text" name="txt1" onchange="this.form.rdo1[1].checked = true;" />
</p></form>


You have to specify the correct array index for the radio button in each textbox's onchange event (i.e. rdo1[0] must be incremented for each control).