Hi,
I am trying to fix up some code and have run into a problem. For some reason the line of code
is not assigning a value when the page is loaded in firefox but in IE it works perfectly.Code:var sizeQ = gid("q" + aq).length;
Please see the complete function below:
If anyone could help me out with this i would be very greatful.Code:function testAnswers(aqNow,review,toClose){ //alert("inside test answers"); var listQa = gid("listQuestions").value; var arrListQa = listQa.split(","); var arrToClose = toClose.split(","); //alert("question answered ->"+arrListQa.length); //alert("array is " + listQa); if(listQa!="" && review != "true"){ //alert("inside first part"); for (var i=0; i < arrListQa.length; i++){ var aq = arrListQa[i]; alert("aq is " + aq); // gid("debug").innerHTML += aq+"<br>"; //if(aq != aqNow){ var sizeQ = gid("q" + aq).length; alert("sizeQ is " + sizeQ); /* var test = gid("q"+aq); alert("test is" + test); var test2 = document.getElementById(test.length); alert("VALUE: " + test2); var test3= document.getElementById(aq); alert("test3 is" + test3); alert("does this work: " + gid("q" + aq).length); */ //gid("debug").innerHTML += sizeQ+"<br>"; //alert("question answered ->"+sizeQ); var contQ = 0; var contQA = 0; for (var j=0; j < sizeQ; j++) { typField = gid("q"+aq)[j].type; if (((typField == "radio" || typField == "checkbox")&& gid("q"+aq)[j].checked) || (typField == "text" && gid("q"+aq)[j].value != "")){ contQA ++; } name = gid("q"+aq)[j].name; if (name!=nameNow){ nameNow = name; contQ +=1; } //if(typField == "checkbox"){gid("debug").innerHTML +="[checkbox]"+gid("q"+aq)[j].checked + "<br>";} //gid("debug").innerHTML += name+"["+contQA + " - " + contQ+"]<br>"; } if((contQA >= contQ) && (contQA != 0)){ alert("inside control if statement"); controlSeeMore(aq); }; //} } }
Thanks in advace,
almac007


Reply With Quote

Bookmarks