Form Reset Query

liunx

Guest
Hi there<br />
<br />
As part of a small asp site I'm using "History.back(1)" for a button on a results page to allow the user to return to the previous page and fill in a form.<br />
<br />
However I want the form to be reset. <br />
<br />
I can't do it on form load, as this would obviously clear it every time the page is loaded. This is no good because the user also has the option to go back to the page to amend form data they've inputted.<br />
<br />
How do I go about doing this?<br />
<br />
cheers<br />
Andy<!--content-->Well since the page is processed on the server, you could use ASP's server variables collection.<br />
<br />
try something like this rather than using JavaScripts history method.<br />
<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"<%= Split(Request.serverVariables("HTTP_REFERER"),"?")(0) %>">Go Back</a><br />
<br />
<br />
This wil force the page to be reloaded and the previous data wil be lost.<br />
<br />
Regards,<br />
Andrew Buntine.<!--content-->Andrew<br />
cheers for the reply.<br />
<br />
The problem with reloading the page is that login details are lost and the user has to go back to the first page and sign in again. This is done for security in case the url of the form page is copied and used (or whatever) later.<br />
<br />
So I still just want to be able to go backwards from the results page and essentially either leave the form as it is (ie with previous data) or clear it automatically.<br />
<br />
I have got a reset button on the form , but it would be nicer if I could clear it automatically.<!--content-->Ok, how are you storing the login details? Personally, i think the best method would be to use session variables so your dont have to cart around username and password details from page to page..<!--content-->I'm not using session variables, as the site is a licencing utility that only has 3 pages (log-in, detail entry & results) .. but realise that I probably should. I guess this would make life easier.<!--content-->
 
Back
Top