Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Problem supporting both IE and FireFox. (properly formatted repost)

    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

    Code:
    <!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>

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Add the parts in bold
    Code:
    	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();
    	}
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you so much. this appears to have solved all issue, let me know if you need me for any aimless grunt work.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •