Forum Moderators: open
the problem stems from IE and MOZ having different namings for the document internals... for example,in a javascript,
var former = document.forms.quiz;
accesses the elements of a form named "quiz" like "former.q5[0].checked"... this works in IE but fails in MOZ...
basically, i'm down to needing some basic browser detection and then being able to assign the vars based on the browser and hopefully everything will fall neatly into place... the problem is that i don't know what the different browsers use for their internal document structure namings... that and i can't locate my browser detection stuffs :(
the solution was to code the following...
function analyzeForm() {
var total = 0;
// document.all exists in IE
if (document.all) {
former = document.forms.quiz;
}
// document.getElementById() is used with GECKO browsers
else if (document.getElementById("quiz")) {
former = document.getElementById("quiz");
}
[do whatever]
}
one place that i thought i'd have problems was updating the textarea with the result message. however, "document.quiz.result.value = msg;" where msg has been assigned a value works just fine in both IE and MOZ which i find rather "interesting"... especially since the textarea resides within the form container...