/    Sign up×
Community /Pin to ProfileBookmark

Validating quiz form – please help!

Hello, clever people!

I am in the making of a quiz with 5 questions, all with 3 radio options through radio buttons. The questions are all on the same side. I want to get a pop-up telling which answer is wrong when pushing the submit button. If all questions are right answered, the submit button simply put the user to a new confirmation side.

I have surfed through dozens of sites, but can only find validation scripts that just check if a button is checked or not.

I am getting sore eyes, bad shoulders and grey hair. I have to deliver this tomorrow.

Anyone to help?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Tweak4May 24.2007 — Offhand, I'd say create an array to store your answers. Each element in the array would represent one question, and the value of that element would be the answer that is correct. When the user hits the "submit" button, you simply spin through the array and compare each element's value to the select value of the respective question. If they match, the answer is right, if not, it isn't.
Copy linkTweet thisAlerts:
@prs64authorMay 24.2007 — I would be really happy to get an example of code to do this. I am more the cut and paste-guy than the script developer. Right now I'm so stressed on time (and stressedin general) that I can't think clear - and don't have much time trying and failing on this. 10 000 thanks on advance!
×

Success!

Help @prs64 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...