By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,160 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,160 IT Pros & Developers. It's quick & easy.

How does one get the answer to clear when user refreshes page?

tpgames
100+
P: 785
Here is the code for 1 question and answer, and the play again code. When I use a play again code, the answers do not erase.
What code am I missing? Thanks!

[HTML]<tr><td class="line1" colspan="4">
<br>
<tr><td class="question" colspan="4">
<!--QUESTION20-->

<b> 20) Which picture shows Jessie <br>
carrying a Living Stone? </b>
<td><div id="Incorrect20"></div>

<!--ANSWERS20-->
<tr>
<td class="answers">
A)
<img src="http://i107.photobucket.com/albums/m287/tpkyteroo/blue/exam/3.jpg" width="150" height="150" alt="">
<br>
<input type="checkbox" name="" id="Q20A">
<label for="Q20A"> * ANSWER * </label>

<td class="answers">
B)
<img src="http://i107.photobucket.com/albums/m287/tpkyteroo/blue/exam/26.jpg" width="150" height="150" alt="">
<br>
<input type="checkbox" name="A20" id="Q20B">
<label for="Q20B"> * ANSWER * </label>

<td class="answers">
C)
<img src="http://i107.photobucket.com/albums/m287/tpkyteroo/blue/exam/27.jpg" width="150" height="150" alt="">
<br>
<input type="checkbox" name="" id="Q20C">
<label for="Q20C"> * ANSWER * </label>

<td class="answers">
D)
<img src="http://i107.photobucket.com/albums/m287/tpkyteroo/blue/exam/37.jpg" width="150" height="150" alt="">
<br>
<input type="checkbox" name="" id="Q20D">
<label for="Q20D"> * ANSWER * </label>

<form method="GET" action="refreshbutton.htm">
<p><input type="button" onclick="refresh()" value="Play Again!!!"
name="button1"></p>
</form>


[/HTML]

I did find a silly work around, but forcing user to navigate off page and then back to the page is a bit much.
If you need the page link, its at http://www.tpgames.net/gaming/2/exam/math/1/mycode.html
(I have issues getting links right using ff, so skiped it this time.)
Thanks again!
Jan 31 '07 #1
Share this Question
Share on Google+
4 Replies


acoder
Expert Mod 15k+
P: 16,027
Just use a reset button.
Jan 31 '07 #2

tpgames
100+
P: 785
Whats the difference in code between a refresh button and a reset button?
How does the reset button reset all the answers to all 20 questions?
Thanks!
Jan 31 '07 #3

acoder
Expert Mod 15k+
P: 16,027
A reset button is an automatic feature easily included with any form by adding the following line:
[HTML]<input type="reset" ...etc..[/HTML]
The beauty is that the effect is instant. It resets everything on the form to its state when the page loaded.
Jan 31 '07 #4

tpgames
100+
P: 785
Never mind! I figured out my questions. :>) I got it to work. Thanks for your info!
Jan 31 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.