Closed Thread Icon

Preserved Topic: how do i make a radio button checked. Pages that link to <a href="https://ozoneasylum.com/backlink?for=18329" title="Pages that link to Preserved Topic: how do i make a radio button checked." rel="nofollow" >Preserved Topic: how do i make a radio button checked.\

 
Author Thread
GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 01-20-2002 13:40

ok, i have a group of radiobuttons like:

<input type="radio" name="ttype" checked value="r1">
<input type="radio" name="ttype" value="r2">
...

then, i want to make a specific one of them checked on the fly, but how can i access them. the only thing that makes them different is the value...

formname.ttype.r1.checked; didnt work.


lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 01-20-2002 15:24

when form vars have same name, js will make them an array, therefore:

formname.ttype[0].checked=true // for r1
[1].checked=true // for r2


[This message has been edited by lallous (edited 01-20-2002).]

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 01-20-2002 15:36

bingo! that was it!
thank you very much, lallous.

« BackwardsOnwards »

Show Forum Drop Down Menu