I have some radio buttons in a form with the following names, e1,e2,e3,f1,f2, the user can select their langauage ability in both languages languages, however, i need only the summed value highest scoring language set (either english or french). to simplify things it would look like this:
English---read---write---speak
excellent-e1-----e2------e3
well-------e1-----e2------e3
poor------e1-----e2------e3
French-----read-----write-----speak
excellent----f1-------f2--------f3
well----------f1-------f2--------f3
poor---------f1-------f2--------f3
So i'm basically trying to add up the English values and then the French and see if the english selections are greateer than the french or vice versa, then i'm transposing this larger language set to a variable (lan)
The following only comes up with lan = 0, its like the code has teh correct syntax but the radio values are not being used to calculate the if then statement at the end, why does a1 & a2 variable have no value?
function Process () {
var itemchecked = false;
var data = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"";
var a1 = a2 = lan = 0;
fr1 = document.f8;
x=1;
while(eval("fr1.e"+x)){
if(eval("fr1.e"+x+".checked")){
a1+=parseInt(eval("fr1.e"+x+".value"));
}
x++;
}
fr2 = document.f8;
y=1;
while(eval("fr2.f"+y)){
if(eval("fr2.f"+y+".checked")){
a2+=parseInt(eval("fr2.f"+y+".value"));
}
y++;
}
if (a1 > a2) {
lan = a1;
}else{
if (a2 > a1) {
lan = a2;
}else{
if (a2 = a1) {
lan = a1;
}
}
}
}
English---read---write---speak
excellent-e1-----e2------e3
well-------e1-----e2------e3
poor------e1-----e2------e3
French-----read-----write-----speak
excellent----f1-------f2--------f3
well----------f1-------f2--------f3
poor---------f1-------f2--------f3
So i'm basically trying to add up the English values and then the French and see if the english selections are greateer than the french or vice versa, then i'm transposing this larger language set to a variable (lan)
The following only comes up with lan = 0, its like the code has teh correct syntax but the radio values are not being used to calculate the if then statement at the end, why does a1 & a2 variable have no value?
function Process () {
var itemchecked = false;
var data = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"";
var a1 = a2 = lan = 0;
fr1 = document.f8;
x=1;
while(eval("fr1.e"+x)){
if(eval("fr1.e"+x+".checked")){
a1+=parseInt(eval("fr1.e"+x+".value"));
}
x++;
}
fr2 = document.f8;
y=1;
while(eval("fr2.f"+y)){
if(eval("fr2.f"+y+".checked")){
a2+=parseInt(eval("fr2.f"+y+".value"));
}
y++;
}
if (a1 > a2) {
lan = a1;
}else{
if (a2 > a1) {
lan = a2;
}else{
if (a2 = a1) {
lan = a1;
}
}
}
}