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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get radio button value without form tags 1

Status
Not open for further replies.

tester321

Programmer
Mar 13, 2007
150
CA
<input type="radio" value="0" checked name="R1" />

<input type="radio" value="1" name="R1" />

Hi when R1 group value remains "0", i need to alert("hi")

how can i reference this without form tags, thanks!@
 
how can i reference this without form tags

Probably the easiest way:
Code:
var radioArray = document.[!]getElementsByName[/!]("R1");

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B> bites again.[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top