memphisTNdev22
Programmer
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> ·
Activations<input type="radio" name="upgrades" value="no" > ·
Upgrades<input type="radio" name="upgrades" value="only"> ·
Warranty Exch.<input type="radio" name = "upgrades" value="warrant">
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> ·
Activations<input type="radio" name="upgrades" value="no" > ·
Upgrades<input type="radio" name="upgrades" value="only"> ·
Warranty Exch.<input type="radio" name = "upgrades" value="warrant">