I have a form but I would like to use Javascript to give a mark for each question that is right (each one is out of 10), then display the total mark at the bottom.
here is my HTML code for the form:
Obviously I have three seperate questions, can anyone tell me the JavaScript code please to do what I need to do?
Thanks.
Chris
here is my HTML code for the form:
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="">
<p>1. Which football club won the European Cup in 1982?</p>
<p>
<input type="radio" name="radiobutton" value="radiobutton">
Aston Villa</p>
<p>
<input type="radio" name="radiobutton" value="radiobutton">
Manchester United</p>
<p>
<input type="radio" name="radiobutton" value="radiobutton">
Real Madrid</p>
<p>2. Which Welsh centre forward struck the winner in his debut match against
England?</p>
<p>
<input type="radio" name="radiobutton" value="radiobutton">
Ian Rush</p>
<p>
<input type="radio" name="radiobutton" value="radiobutton">
Mark Hughes</p>
<p>
<input type="radio" name="radiobutton" value="radiobutton">
The late John Charles C.B.E.</p>
<p>3. Who scored the 800th ever goal of the F.A. Premiership?</p>
<p>
<input type="radio" name="radiobutton" value="radiobutton">
Eric Cantona</p>
<p>
<input type="radio" name="radiobutton" value="radiobutton">
Dwight Yorke</p>
<p>
<input type="radio" name="radiobutton" value="radiobutton">
Alan Shearer</p>
</form>
<p> </p>
<p>Your Score Was: </p>
</body>
</html>
Obviously I have three seperate questions, can anyone tell me the JavaScript code please to do what I need to do?
Thanks.
Chris