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 Chriss Miller 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
Joined
Jan 3, 2006
Messages
7
Location
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">
 
You're not touching "upgrades" anywhere in that code, so I can only assume you have other code affecting it. Why not post the whole code, or a URL to it?

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top