I have reorganized my script and have something to show you what I mean.
Oh and by the way, the reason I do not use the submit button is because when it submits, it also refreshes. So as far as I know, when it refreshes all the values return to they're original state.
<script type="text/javascript" language="javascript">
<!--
var totalcorrect = 0
var x = totalcorrect + 1
function validateform01( ) {
if (document.form01.radio01[0].checked || document.form01.radio01[1].checked || document.form01.radio01[3].checked) {
alert("Incorrect! The correct answer was 4. Click OK to continue to the next problem.")
}
if (document.form01.radio01[2].checked){
var totalcorrect = x
alert("Correct! Click OK to continue to the next problem." + calculatetotalcorrect( ))
}
}
function swap(obj,newsrc) {
obj.src = newsrc;
}
//-->
</script>
<body>
<A HREF="#question2"><IMG SRC="image1.
gif" NAME="image" BORDER="0" onclick="validateform01( )"></A>
</body>