JavaScript - problemas con javascript en IE

   
Vista:

problemas con javascript en IE

Publicado por gustavo (1 intervención) el 22/10/2007 18:07:43
Tengo problemas con con una encuesta en javascript que no anda en internet Explorer 6 y si en mozilla
<SCRIPT language=javascript>
<!--
var points = 0;
var userQ1, userQ2, userQ3, userQ4, userQ5, userQ6, userQ7, userQ8, userQ9, userQ10 = null;
var answers = ["true", "true", "true", "false", "false", "true", "false", "true", "true", "true"];
var pass = true;
var questions;

function testResults(form)
{
pass = true;
questions = "";
q= "";
for(q=1; q<=10; q++) {
if(!(eval("form.Q"+q+"[0].checked") || eval("form.Q"+q+"[1].checked"))) {
pass = false;
questions += q + " ";
}
}

if(pass){
if(!userQ1){
for(count=0; count < 2; count++){
if(form.Q1[count].checked) break;
}

userQ1 = form.Q1[count].value;
form.resultQ1.value = answers[0];
points += (userQ1 == answers[0]) ? 1:0;
}
if(!userQ2){
for(count=0; count < 2; count++){
if(form.Q2[count].checked) break;
}

userQ2 = form.Q2[count].value;
form.resultQ2.value = answers[1];
points += (userQ2 == answers[1]) ? 1:0;
}
if(!userQ3){
for(count=0; count < 2; count++){
if(form.Q3[count].checked) break;
}

userQ3 = form.Q3[count].value;
form.resultQ3.value = answers[2];
points += (userQ3 == answers[2]) ? 1:0;
}
if(!userQ4){
for(count=0; count < 2; count++){
if(form.Q4[count].checked) break;
}

userQ4 = form.Q4[count].value;
form.resultQ4.value = answers[3];
points += (userQ4 == answers[3]) ? 1:0;
}
if(!userQ5){
for(count=0; count < 2; count++){
if(form.Q5[count].checked) break;
}

userQ5 = form.Q5[count].value;
form.resultQ5.value = answers[4];
points += (userQ5 == answers[4]) ? 1:0;
}
if(!userQ6){
for(count=0; count < 2; count++){
if(form.Q6[count].checked) break;
}

userQ6 = form.Q6[count].value;
form.resultQ6.value = answers[5];
points += (userQ6 == answers[5]) ? 1:0;
}
if(!userQ7){
for(count=0; count < 2; count++){
if(form.Q7[count].checked) break;
}

userQ7 = form.Q7[count].value;
form.resultQ7.value = answers[6];
points += (userQ7 == answers[6]) ? 1:0;
}
if(!userQ8){
for(count=0; count < 2; count++){
if(form.Q8[count].checked) break;
}

userQ8 = form.Q8[count].value;
form.resultQ8.value = answers[7];
points += (userQ8 == answers[7]) ? 1:0;
}
if(!userQ9){
for(count=0; count < 2; count++){
if(form.Q9[count].checked) break;
}

userQ9 = form.Q9[count].value;
form.resultQ9.value = answers[8];
points += (userQ9 == answers[8]) ? 1:0;
}
if(!userQ10){
for(count=0; count < 2; count++){
if(form.Q10[count].checked) break;
}

userQ10 = form.Q10[count].value;
form.resultQ10.value = answers[9];
points += (userQ10 == answers[9]) ? 1:0;
}
//alert("you have " + (points*10) + "%");
form.result.value = "Your score is " + (points*10) + "%";
} else if(questions.length < 4) alert("Question " + questions + "has not been answered to compile results. Make sure all the question are answered.");
else alert("Questions " + questions + "have not been answered to compile results. Make sure all the question are answered.");
}
//-->
</SCRIPT>

Porfavor ayudenmé
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder