<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2712.300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV>Here's one: </DIV>
<DIV>&nbsp;</DIV>
<DIV>I've got a function that I use to identify which radio button a user 
selects. It works great if you have more than one radio button in the 
group.</DIV>
<DIV>&nbsp;</DIV>
<DIV>My problem is that my radio buttons are dynamically generated, and 
sometimes only one radio button is in the group.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Can someone see what the problem is which my function, get_radio_value()? 
To make the snippet below work correctly, uncomment the second radio 
button.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Best,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Bill</DIV>
<DIV>&nbsp;</DIV>&lt;script language=javascript&gt;<BR>&lt;!--<BR>function 
get_radio_value (radio_array)<BR>{<BR>&nbsp;var i;<BR>&nbsp;for (i = 0; i &lt; 
radio_array . length; ++ i)<BR>&nbsp;&nbsp;if (radio_array [i] . 
checked)<BR>&nbsp;&nbsp;&nbsp;return radio_array [i] . value;<BR>&nbsp;return 
null; <BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>function run_choice() {<BR>&nbsp;document.write( 
get_radio_value(sel.radiobutton) )<BR>&nbsp;document.write("&lt;p&gt;&lt;input 
type=button value=Back")<BR>&nbsp;document.write(" 
onClick='history.back()'&gt;")<BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>//--&gt;<BR>&lt;/script&gt;<BR>&lt;form name=sel 
method=post&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input type="radio" 
name="radiobutton" value="01003"&gt;01003<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;!-- input type="radio" name="radiobutton" value="01004"&gt;01004 
--&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p&gt;&lt;input 
type=button name=ok value=OK 
onClick='run_choice()'&gt;<BR>&lt;/form&gt;<BR></FONT></DIV></BODY></HTML>