Forum Moderators: open

Message Too Old, No Replies

Back button

         

rorlini

6:15 pm on May 18, 2004 (gmt 0)

10+ Year Member



Is there a way to make a back button that will go back one page without saving info on that page?

korkus2000

6:37 pm on May 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure what this means:
>>without saving info on that page

DrDoc

7:30 pm on May 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not sure what this means:
>>without saving info on that page

For example... Click "Reply to this topic", start typing, click "Back", click "Forward"... Whatever you typed is now "saved".

Why do you want to disable that? I'm not sure if onload will help or not... Or perhaps a timer? Or perhaps check the window history to see if there are pages after the current one (meaning -- they've clicked "Back"). If so, clear the fields...

Rambo Tribble

2:09 am on May 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have opened your page in a named window, you can use window.open(), specifying the same window, with the replace option to cause the page being loaded to replace the current page in the browser's history. Is that the sort of thing you mean?

DrDoc

4:28 am on May 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or, simply provide a link to the previous page...
The information is only preserved when using the browser's abck button, or navigating in the window history.

jomaxx

5:11 am on May 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might be able to use the "expires" meta tag on the page to force a refresh. Or use Javascript to re-init fields on the page. Not certain if either of those approaches would work or not; I guess it would somewhat depend on what you're trying to accomplish.

bgrobe

9:29 pm on May 31, 2004 (gmt 0)

10+ Year Member



write a javascript clear function that sets all of the boxes ="" when the page loads, or when they click a back button YOU make:

<html><title>Blah!</title>
<head>
<script language=javascript>
<!--
function clear()
{
document.testform.box1.value="";
document.testform.box2.value="";
}
//-->
</script>
</head>
<body onLoad=clear()>
<form name=testform>
<input name=box1 type=text><br>
<input name=box2 type=text>
</form><input type=button onClick=history.back() value=Back></body></html>

I think that will do it. I think the onLoad function executes even if you are using a back button.