CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   DOM and JSON scripting (http://www.codingforums.com/forumdisplay.php?f=15)
-   -   I need help with this Javascript function please (http://www.codingforums.com/showthread.php?t=281602)

Ngene 11-08-2012 11:19 PM

I need help with this Javascript function please
 
Please help me out, i need help with this code.I attached this function to the on-click event of a button I need it to automatically write a new question to the page after checking the answer of the previous question, without reloading the page.I need it to loop continuously to the end of the questions array. Please help me out.

[CODE]
function buttonCheckQ_onclick()
{
var answer = 0;
while (document.QuestionForm.radQuestionChoice[answer].checked != true)
{
answer++;
}
answer = String.fromCharCode(65 + answer);
if (answerCorrect (questionNumber, answer) == true)
{
alert("Right answer");
}
else
{
alert("Wrong answer. " + answers[questionNumber] + " is the right answer.");
}
for (var qCounter = 0;qCounter < questions.length; qCounter++)
{
document.getElementById('questionDisplay').innerHTML = "";
QuestionFormDisplay()
window.location.reload()
}
}
[CODE]


All times are GMT +1. The time now is 09:53 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.