...

View Full Version : Problem supporting both IE and FireFox. (properly formatted repost)



ziggah
12-05-2006, 05:59 AM
My main problem tackling this is it seems to work fine for me.. however some people report either it not loading at all in firefox, or loading forever at the result. Any ideas guys? http://www.3rdoct.org/zig/quiz.html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
a = 0
b = 0
c = 0
d = 0
e = 0
f = 0
g = 0
function zig()
{
if (document.getElementById("answer1").checked==true)
{
e=e+10
}
else if (document.getElementById("answer1").checked==false)
{
}
if (document.getElementById("answer2").checked==true)
{
e=e+5
}
else if (document.getElementById("answer2").checked==false)
{
}
if (document.getElementById("answer3").checked==true)
{
a=a+10
}
else if (document.getElementById("answer3").checked==false)
{
}
if (document.getElementById("answer4").checked==true)
{
e=e+20
}
else if (document.getElementById("answer4").checked==false)
{
}
if (document.getElementById("answer5").checked==true)
{
e=e+5
}
else if (document.getElementById("answer5").checked==false)
{
}
if (document.getElementById("answer6").checked==true)
{
e=e+10
}
else if (document.getElementById("answer6").checked==false)
{
}
if (document.getElementById("answer7").checked==true)
{
e=e+20
}
else if (document.getElementById("answer7").checked==false)
{
}
if (document.getElementById("answer8").checked==true)
{
a=a+10
}
else if (document.getElementById("answer8").checked==false)
{
}
if (a==0 && e==0)
{
document.write("e:"+e + "<br/> " + "a:"+a+"<br/>" + "You did not select anything.."+ "<br>")
}
else if (a>0 || e>0)
{
document.write("e:"+e + "<br/> " + "a:"+a+"<br/>" + "Explanation: With this code I get to define how each of my variables are effected by selected answers, thus allowing me to later effect the test results, in this case e will equal ineptitude while a will equal aptitude. Or Something.")
}
}
</script>
</head>
<body>
<script type="text/javascript">

</script>
<form action="">
This is a sample quiz I guess. How many licks does it take to get to the center of a tootsie pop?
<br />
<input type="radio" name="question1" id="answer1"/>
ahh one...
<br />
<input type="radio" name="question1" id="answer2"/>
ahh two...
<br />
<input type="radio" name="question1" id="answer3"/>
ahh three...
<br />
<input type="radio" name="question1" id="answer4"/>
can't tell :(
</form>
<form action="">
<br />
This is sample question two.. I suppose. What color is the sky?
<br />
<input type="radio" name="question2" id="answer5"/>
Whats a sky?
<br />
<input type="radio" name="question2" id="answer6"/>
Huh?
<br />
<input type="radio" name="question2" id="answer7"/>
(drooling)
<br />
<input type="radio" name="question2" id="answer8"/>
Blue at day and black at night
<br />
<br />
<input type="submit" name="submit" id="submit" value="Complete Test" onclick="zig()" />
-Zig
</form>
</body>
</html>

_Aerospace_Eng_
12-05-2006, 07:39 AM
Add the parts in bold

if (a==0 && e==0)
{
document.write("e:"+e + "<br/> " + "a:"+a+"<br/>" + "You did not select anything.."+ "<br>")
document.close();
}
else if (a>0 || e>0)
{
document.write("e:"+e + "<br/> " + "a:"+a+"<br/>" + "Explanation: With this code I get to define how each of my variables are effected by selected answers, thus allowing me to later effect the test results, in this case e will equal ineptitude while a will equal aptitude. Or Something.")
document.close();
}

ziggah
12-05-2006, 08:14 AM
Thank you so much. this appears to have solved all issue, let me know if you need me for any aimless grunt work.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum