...

View Full Version : Can't get javascript quiz to work properly?



clement
12-30-2010, 01:23 PM
Hi - would appreciate some help with this school project. I can't get this simple quiz to work correctly, it should give a pop-up with a pass/fail message on submit. Can anyone see the error?

Instead of posting the whole code - the live version is here with all the code in the doc head...

http://bit.ly/hR8JYk

Philip M
12-30-2010, 01:28 PM
Have you tried using your error console?

line 13 document.myform.q1 is null or not an object.


It is your responsibility to die() if necessary….. - PHP Manual

clement
12-30-2010, 03:12 PM
Hi- have corrected the Array entry to read quiz.q1, quiz.q2 etc....

Still not working although am nearly there... can sense it!!!

Logic Ali
12-30-2010, 03:43 PM
Still not working although am nearly there... can sense it!!!Yes - all you have to do is look at the console again:
Error: syntax error
Source File: http://www.liamcarey.com/pages/quiz.html
Line: 1, Column: 8
Source Code:
onclick=return checkAnswers()

clement
12-31-2010, 12:47 PM
Yes - all you have to do is look at the console again:
Error: syntax error
Source File: http://www.liamcarey.com/pages/quiz.html
Line: 1, Column: 8
Source Code:
onclick=return checkAnswers()


What console do you mean? Am using Dreamweaver and it doesn't show any errors? What is the correct code if this one is wrong?

Logic Ali
12-31-2010, 01:29 PM
What console do you mean? Am using Dreamweaver and it doesn't show any errors? What is the correct code if this one is wrong?
Firefox -> Tools Menu / Error Console

It seems you've fixed that problem but now the console is indicating another problem:

Error: allQuestions is undefined
Source File: http://www.liamcarey.com/pages/quiz.html
Line: 41



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum