I have a form that takes the value of a checked radio button and passes that to another button. Then that new button passes its checked value to another new button.
My problem is, once the third button is checked, you can go back and change the first button, but the third button value still remains the same. For example:
radgroup1 value x checked
radgroup2 value x checked
radgroup3 value x checked
Then you decide to change radgroup1 to y so you have
radgroup1 value y checked
radgroup2 value x checked
radgroup3 value x checked
When this can't be because you are passing the values from radiogroup to radiogroup. So, ideally, when you change x to y, it would then in turn change all the x's to y's. Here is a section of my code. If it helps, this is a basketball bracket for those of you who know what that is.
Dodge20
My problem is, once the third button is checked, you can go back and change the first button, but the third button value still remains the same. For example:
radgroup1 value x checked
radgroup2 value x checked
radgroup3 value x checked
Then you decide to change radgroup1 to y so you have
radgroup1 value y checked
radgroup2 value x checked
radgroup3 value x checked
When this can't be because you are passing the values from radiogroup to radiogroup. So, ideally, when you change x to y, it would then in turn change all the x's to y's. Here is a section of my code. If it helps, this is a basketball bracket for those of you who know what that is.
Code:
<script>
function dothis(obj1,obj2,obj3)
{
var frm = document.frm
for(i =0; i <frm[obj1].length; i++)
{
if(frm[obj1][i].checked)
var temp = frm[obj1][i].value
}
for(i =0; i <frm[obj2].length; i++)
{
if(frm[obj2][i].checked)
var temp2 = frm[obj2][i].value
}
document.frm[obj3][0].value = temp;
document.frm[obj3][1].value = temp2;
document.getElementById(obj3+'_0').innerHTML = temp;
document.getElementById(obj3+'_1').innerHTML = temp2;
}
function dothis2(obj)
{
var frm = document.frm
for(i =0; i <frm[obj].length; i++)
{
if(frm[obj][i].checked)
var temp = frm[obj][i].value
}
document.getElementById('me').innerHTML = "THE WINNER IS \n"+temp
}
</script>
<input type="radio" name="r1g8" value="Gonzaga"
onclick = "dothis('r1g7','r1g8','r2g4');">
<FONT FACE="Arial Narrow, Arial" SIZE="2"><font face="Times New Roman, Times, serif">Gonzaga</font></FONT></label>
<br>
<label>
<input type="radio" name="r1g8" value="Valparasio"
onclick = "dothis('r1g7','r1g8','r2g4');">
<FONT FACE="Times New Roman, Times, serif" SIZE="2">Valparasio
<input type="radio" name="r2g4"onclick = "dothis('r2g3','r2g4','r3g2');">
<span id = "r2g4_0"></span>
</label>
<br>
<label>
<input type="radio" name="r2g4" onclick = "dothis('r2g3','r2g4','r3g2');">
<span id = "r2g4_1"></span>
</label>
<input type="radio" name="r3g2" onclick = "dothis('r3g3','r3g4','r4g1');">
<span id = "r3g2_0"></span>
</label>
<br>
<label>
<input type="radio" name="r3g2" onclick = "dothis('r3g3','r3g4','r4g1');">
<span id = "r3g2_1"></span>
</label>
Dodge20