I have this function, which should change a value of the texfield(s)
depending on the radio buttons selection.
function foo(obj) {
if (!array[obj.name]) { flag++; }
if (array[obj.name] != obj.value ) {
array[obj.name]=obj.value;
if (array[obj.name]=='no' && ( array1[obj.name]=='yes' ||
!array1[obj.name] ) ) {
if (mandatory<=21) { mandtory++; }
document.form1.ManProNuErr.value=parseInt(window.d ocument.form1.ManProNuErr.value)
+ 1;
array1[obj.name]=obj.value;
array2[obj.name]='';
alert ("no");
}
if (array[obj.name]=='na' && (array1[obj.value]=='' ||
array1[obj.value]=='yes') ) { mandatory-- ;}
if ((array[obj.name]=='yes' && array1[obj.name]=='no' ) ||
(array[obj.name]=='na' && array1[obj.name]=='no') ) {
if (array[obj.name]=='na') {
mandatory--;
alert ("na");
array2[obj.name]='na';
array1[obj.name]='yes';
document.form1.ManProNuErr.value=parseInt(window.d ocument.form1.ManProNuErr.value)
- 1;
}
else if (array[obj.name]=='yes') {
<b> if (mandatory<=21) { mandtory++; } </b>
document.form1.ManProNuErr.value=parseInt(window.d ocument.form1.ManProNuErr.value)
- 1;
array1[obj.name]=obj.value;
array2[obj.name]='';
alert("yes");
}
}
}
}
document.form1.ManProPrsErr.value=roundit((mandato ry-parseInt(document.form1.ManProNuErr.value))/mandatory*100,
2) + '%';
}
So the function works greate if i remove the lines "if (mandatory<=21)
{ mandtory++; } " there are two of them, one is when no is pressed and
another one is when yes is pressed.
And the error i recive is kinda clueless object expected, pointing to
the html line: " <td class="style17"><span class="style9"></span></td>"
But to calcuate the percentage, i need those lines to be able to know
how many 'na's were pressed.
Any1 have any idea??