简体   繁体   中英

history.back() wont work in popup window IE

I am creating a simple email form, where the user clicks a button and it opens a popup window, you can then progress through the form.

Now i have put a back button on there, which works in chrome. When you click it, it returns to the previous page retaining all of its data. But when i come to use it in IE it does not work, unsurprisingly. It does, however, work if it is not in a popup window in IE.

So what is wrong with this popup window?

This is the code i am using to open the window, i am starting to think that the lack of a toolbar, back and forward buttons etc; is the cause of this problem.

   <input type=submit value="Get Quote" onclick="window.open('test_email1.html','mywindow','width=800,height=450','toolbar=yes', 'status=yes')">

Browsers determine how they populate fields for pages from browser history. I know Firefox frequently remembers and fills fields (not always desirable) and IE doesn't as much (also not always desirable).

If you prefer a particular behavior, you'll probably have to implement it on the server side.

In other words, use your server-side language of choice (Java, PHP, .NET) to store the data as it gets submitted. Create a custom back button that requests the form pre-populated with the saved data.

This is probably way more complex than you were hoping for, but unless you have the power to force your users to a particular browser, you won't find an clientside-only solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM