Hi i'm trying to count the number of radio groups on a page and if less than 80% do not have a selection then disable the submit button, other wise enable it. I'm putting an onclick on each radio to call the function, plus a window.lonad event to call the same function. This is the function i have wich seems ill, any thoughts?
Thanks
Code:
function countRadio(){
var allR = document.getElementsByTagName('input');
int a=1;
for(var i=0;i<allR.length;i++){
if(allR[i].type=='radio'){
a++;
}
}
int Rcount = allR.length;
Rcount = Rcount%80;
if (Rcount < a)
{
document.forms[0].elements['Button1'].disabled = true;
document.forms[0].elements['Button2'].disabled = true;
}
}
Thanks