Questions about redirecting with Location.replace

Asked

Viewed 43 times

0

I am sending a form with AJAX and after sending, and the JSON return is positive, the user is redirected, I am using the method window.location.replace(redir_url), but I am still able to go back to the previous page and see the form that has already been sent filled, what to do so that the user is redirected and cannot go back in the history?

  • 3

    Why not clean FORM after submitting? http://stackoverflow.com/a/8701877/6054930

  • 6

    This suggestion is even better. Lightly related: there should be no problem your user come back and find of sent form. Design your system so that if it does, it can’t take any action that compromises the system. You can’t trust either the implementation of each browser or the (sometimes accidental) dexterity of users.

  • Okay, thanks for the suggestion, I’ll take a look.

  • Merge reset() with replace?

  • From what I understand, I can only use the reset in the post method? is because I am using the form with the Dropzone upload plugin that works with the different form.

No answers

Browser other questions tagged

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