Hi,
I am having trouble getting some javascript code to work correctly in mozilla. Shows fine in IE but only works in mozilla one something is changed. The code is simple as i am a beginner at this.
Please see code below.
Thanks in advance
<script language="javascript" type="text/javascript">
function ChangeQ2() {
if (document.getElementById("_Q0_Q0_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q0_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q0_Q1").style.display = 'none';
document.getElementById("_Q0_Q0_Q1").value = "";
}
if (document.getElementById("_Q0_Q1_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q1_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q1_Q1").style.display = 'none';
document.getElementById("_Q0_Q1_Q1").value = "";
}
if (document.getElementById("_Q0_Q2_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q2_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q2_Q1").style.display = 'none';
document.getElementById("_Q0_Q2_Q1").value = "";
}
if (document.getElementById("_Q0_Q3_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q3_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q3_Q1").style.display = 'none';
document.getElementById("_Q0_Q3_Q1").value = "";
}
if (document.getElementById("_Q0_Q4_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q4_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q4_Q1").style.display = 'none';
document.getElementById("_Q0_Q4_Q1").value = "";
}
if (document.getElementById("_Q0_Q5_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q5_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q5_Q1").style.display = 'none';
document.getElementById("_Q0_Q5_Q1").value = "";
}
if (document.getElementById("_Q0_Q6_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q6_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q6_Q1").style.display = 'none';
document.getElementById("_Q0_Q6_Q1").value = "";
}
if (document.getElementById("_Q0_Q7_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q7_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q7_Q1").style.display = 'none';
document.getElementById("_Q0_Q7_Q1").value = "";
}
if (document.getElementById("_Q0_Q8_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q8_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q8_Q1").style.display = 'none';
document.getElementById("_Q0_Q8_Q1").value = "";
}
if (document.getElementById("_Q0_Q9_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q9_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q9_Q1").style.display = 'none';
document.getElementById("_Q0_Q9_Q1").value = "";
}
if (document.getElementById("_Q0_Q10_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q10_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q10_Q1").style.display = 'none';
document.getElementById("_Q0_Q10_Q1").value = "";
}
if (document.getElementById("_Q0_Q11_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q11_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q11_Q1").style.display = 'none';
document.getElementById("_Q0_Q11_Q1").value = "";
}
if (document.getElementById("_Q0_Q12_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q12_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q12_Q1").style.display = 'none';
document.getElementById("_Q0_Q12_Q1").value = "";
}
if (document.getElementById("_Q0_Q13_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q13_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q13_Q1").style.display = 'none';
document.getElementById("_Q0_Q13_Q1").value = "";
}
if (document.getElementById("_Q0_Q14_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q14_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q14_Q1").style.display = 'none';
document.getElementById("_Q0_Q14_Q1").value = "";
}
if (document.getElementById("_Q0_Q15_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q15_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q15_Q1").style.display = 'none';
document.getElementById("_Q0_Q15_Q1").value = "";
}
if (document.getElementById("_Q0_Q16_Q0_C").value == "__Other") {
document.getElementById("_Q0_Q16_Q1").style.display = 'inline';
} else {
document.getElementById("_Q0_Q16_Q1").style.display = 'none';
document.getElementById("_Q0_Q16_Q1").value = "";
}
}
var b = document.getElementsByTagName("Body");
b[0].onload = function() {
showpage();
subtotal();
ChangeQ2();
}
if(document.getElementById("_Q0_Q0_Q0_C")) {
var c = document.getElementById("_Q0_Q0_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q0_Q0_C")) {
var c = document.getElementById("_Q0_Q0_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q0_Q0_C")) {
var c = document.getElementById("_Q0_Q0_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q0_Q0_C")) {
var c = document.getElementById("_Q0_Q0_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q1_Q0_C")) {
var c = document.getElementById("_Q0_Q1_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q2_Q0_C")) {
var c = document.getElementById("_Q0_Q2_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q3_Q0_C")) {
var c = document.getElementById("_Q0_Q3_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q4_Q0_C")) {
var c = document.getElementById("_Q0_Q4_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q5_Q0_C")) {
var c = document.getElementById("_Q0_Q5_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q6_Q0_C")) {
var c = document.getElementById("_Q0_Q6_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q7_Q0_C")) {
var c = document.getElementById("_Q0_Q7_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q8_Q0_C")) {
var c = document.getElementById("_Q0_Q8_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q9_Q0_C")) {
var c = document.getElementById("_Q0_Q9_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q10_Q0_C")) {
var c = document.getElementById("_Q0_Q10_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q11_Q0_C")) {
var c = document.getElementById("_Q0_Q11_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q12_Q0_C")) {
var c = document.getElementById("_Q0_Q12_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q13_Q0_C")) {
var c = document.getElementById("_Q0_Q13_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q14_Q0_C")) {
var c = document.getElementById("_Q0_Q14_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q15_Q0_C")) {
var c = document.getElementById("_Q0_Q15_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
if(document.getElementById("_Q0_Q16_Q0_C")) {
var c = document.getElementById("_Q0_Q16_Q0_C");
//alert(c);
c.onchange = function() {ChangeQ2();}
};
</script>