How to inhibit confirmation "form forwarding"?

Asked

Viewed 1,345 times

0

I have a list of records where I do a search (via post) and after the result select a record through a select, and go to another page to edit this record. It turns out that when I finish editing this record I want to go back to the previous page "window.history.go(-1)", the browser requires confirmation of the resubmission of the form, I know this is a Chrome pattern, but is there any way to get back without it asking for confirmation? I always need to use the post method.

  • And because you’re just using the window.history.go? It would be better to send it to a real URL. Ideally, never use these methods, really. As much as it pays to mess with history, it’s to keep browsing forward and back in Ajax pages, for example (and even then, with a little care). Other than that, it’s almost always a scam.

  • that I know there is no way, most browsers warn that Voce back to a page with POST, liked the opera why did not give this warning. A solution would be to give a window.history.go(-1) and go to the search page again, using the same parameters. there appears that warning.

  • Yeah, I already do by reverse search, but if history.go works would save me a lot of work, I have several pages in that situation.

  • @Bacco why use the window.history.go(-1) is gambiarra?

  • Try to figure out a way to standardize. If you are using something server-side, it is not very difficult. It’s tempting to cut corners, but in this case I think it compromises essential things.

  • 2

    @Marcelo pq first of all, is a behavior that depends on a number of things (the way the user arrived at the page, if it was by link, opened in a new tab, if it came from a Bookmark) and the implementation of the browser. Moreover, it is the type of action that should normally be voluntary (the user controls, not the application). Conceptually it is for other uses. Note that I said "almost" almost always. There may be situations that are justified. But it is almost always a mistake to think that justifies.

  • This 'coming back' would be something simple, in my case it would not compromise anything since I just wanted the previous research to be selected, no matter if there was an update of data. I believe that a data competition would be a problem, but not the case.

  • 1

    Check out this link http://www.theserverside.com/news/1365146/Redirect-After-Post

  • Marcelo understand what you say, but in your case, the fact is that already compromised. As you noticed, in using the back (go -1), has this unfolding for having occurred a POST. I read over the @Magichat link, and it seems very pertinent. The text does not speak of history.go, but what speaks of the forward and return buttons falls into it. If you adopt the practice of "don’t show data in the POST, only in GET", you will have more peace of mind (despite the extra work).

  • 1

    I read the article suggested by @Magichat, really is a very good model, I would have to reprogram all my code, because I use friendly url and hidden the content of the link just so the guy does not save the link and have to come by the origin page, in this case that I am passing a simple GO(-1) would already solve my problem, but the browsers do not work like this, I will have to work a little more, rs, I will use sessions to save the searches. But thanks for the chat, it was very productive.

Show 5 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.