Skip to content Skip to sidebar Skip to footer

How To Do "html Form Action=location.replace('nextpage.html')"?

The title is actually a failed attempt to achieve my goal. Specifically, I want to 1. Go to a page from main.html (say, to page1.html). 2. Collect data in a form on page1. 3. On Su

Solution 1:

It seems the easier way to achieve this is to place a simple <a href=main.html>Ok</a> on your page2.html.

Then associate a flag (maybe a cookie) on this main.html which "instructs" page1.html to clear its form elements if it is not called by main.html, but from a "back" button (by refreshing meta, for example, or by loading page1.html#randomnum, where randomnum is a value you find real time to force your browser understand this is not the "old" page1.html but a "new" page1.html, helping browser not to get this from cache but from web).

The principle is: if page1.html is called by "back", it have to be a "clear" page1.html, not showing any data input user eventually entered.

Post a Comment for "How To Do "html Form Action=location.replace('nextpage.html')"?"