TapeGun007 Posted March 14, 2017 Share Posted March 14, 2017 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 ResubmissionThis 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. Quote Link to comment https://forums.phpfreaks.com/topic/303456-form-re-submission/ Share on other sites More sharing options...
mac_gyver Posted March 14, 2017 Share Posted March 14, 2017 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 Quote Link to comment https://forums.phpfreaks.com/topic/303456-form-re-submission/#findComment-1544232 Share on other sites More sharing options...
TapeGun007 Posted March 14, 2017 Author Share Posted March 14, 2017 Oh I see... ok thanks. Quote Link to comment https://forums.phpfreaks.com/topic/303456-form-re-submission/#findComment-1544233 Share on other sites More sharing options...
Psycho Posted March 14, 2017 Share Posted March 14, 2017 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. Quote Link to comment https://forums.phpfreaks.com/topic/303456-form-re-submission/#findComment-1544234 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.