Jump to content

Recommended Posts

I believe this would be a JS question, but I could be wrong:

 

I query a database, it creates a table with all the matches, and then I click "Edit" next to one of the matches which passes an id so I can edit the user info.  However, if I click 'Back' in the browser, I get the usual

 

 

 

Confirm Form Resubmission

This webpage requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed.

 

  • Press the reload button to resubmit the data needed to load the page.
ERR_CACHE_MISS

 

Is there a way to create a back button that would basically resubmit that form or is that even possible?  Yes, I don't want to have to re-click "refresh" to populate the form again. Call me lazy, I don't care. :)

Link to comment
https://forums.phpfreaks.com/topic/303456-form-re-submission/
Share on other sites

this browser behavior cannot be changed. it occurs anytime the 'last' action for a url was a post method form submission. the way to prevent this is to do a header() redirect, i.e. a get request, to the exact same url after you have finished processing the post method form. see this link - https://en.wikipedia.org/wiki/Post/Redirect/Get

Link to comment
https://forums.phpfreaks.com/topic/303456-form-re-submission/#findComment-1544232
Share on other sites

So, is the scenario that the user selects to edit a record, but then decides they don't want to edit that record and wants to go back to the list of records? For that scenario, I typically implement a "Cancel" button on the edit form that will take the user back to the selection screen. Since your selection list is apparently based on a prior criteria input you could save that input as a session value. Then, clicking the cancel button will pull the search value from session and regenerate the selection list.

Link to comment
https://forums.phpfreaks.com/topic/303456-form-re-submission/#findComment-1544234
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.