Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reload a form?

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi,

I want to do following. After the user submits the information from the form and goes on the second page, if clicks BACK button on the IE, I want to reload form, so the boxes won't have the values previously entered.

How to do that?


Thanks.
 
What you can do is clear input values "onload" of body. Water is not bad as long as it stays out human body ;-)
 
Where to code onLoad event of body?

Thanks.
 
<html>
<head>
<Script language=&quot;Javascript&quot;>
function clearAll() {
var curInput=document.getElementById(&quot;UserName&quot;);
curInput.value=&quot;&quot;;
curInput=document.getElementById(&quot;UserAge&quot;);
curInput.value=&quot;&quot;;
}
</script>
</Head>
<Body onload=&quot;clearAll();&quot;>
<form ID=&quot;Form1&quot;>
<input id=&quot;UserName&quot; type=&quot;text&quot; value=&quot;this won't be shown&quot; NAME=&quot;name&quot;/>
<input id=&quot;UserAge&quot; type=&quot;text&quot; value=&quot;this neither will be shown&quot; NAME=&quot;name&quot;/>
</form>
</body>
</html>
Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top