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

radio button

Status
Not open for further replies.

memphisTNdev22

Programmer
Jan 3, 2006
7
US
I have a function that is called on a select box, but each time the select box value is changed my radio button goes to the value that has the checked attribute next to it.What am I doing wrong here?

Here is the select box function:
function processChangeArea(prev)
{
with (document.mainForm)
{
var selectedArea = new String(area.selectedIndex);

if(selectedArea == 0)
{
area.options[prev].selected = true;
}
else
{

market.options['0'].selected = true;
store.options['0'].selected = true;
document.mainForm.submit();
}

}
}

Here is the select box. This only the first line:
<SELECT NAME=area CLASS=options onFocus="prevArea=area.selectedIndex;" onClick="document.mainForm.action = 'index.jsp';" onChange="processChangeArea(prevArea);" >

Here is the radio buttons:
All<input type="radio" name="upgrades" value="yes" checked>&nbsp;&middot;&nbsp;
Activations<input type="radio" name="upgrades" value="no" > &nbsp;&middot;&nbsp;
Upgrades<input type="radio" name="upgrades" value="only">&nbsp;&middot;&nbsp;
Warranty Exch.<input type="radio" name = "upgrades" value="warrant">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top