Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6353919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:29:36+00:00 2026-05-24T22:29:36+00:00

Is there a way to save the form data so that if the submit

  • 0

Is there a way to save the form data so that if the submit fails they don’t have to retype everything? For some reason, I’m getting an error on my script with Chrome but not with FireFox. It doesn’t always happen with Chrome, and it’s not exactly the main problem. If they submit and then the page doesn’t load, they lose everything they typed when they go back. I’ve thought of only one thing so far, but it doesn’t seem practical. It would be to save the form data to cookies when they press submit.

Is there a better way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:29:37+00:00Added an answer on May 24, 2026 at 10:29 pm

    It depends on what you mean by “submit fails.” If you mean that there is a server error, and they have to press ‘back’, it’s hard.

    However, if you mean fails as in a they-forgot-to-put-an-email kind of fails, here is one solution:

    You can grab the previous values from the $POST or wherever and stick them back into the HTML tags. For instance:

    <?php
    $prevCustEmail = makeItASafeString($_POST['custEmail']);
    ?>
    <input type="text" id="custEmail" name="custEmail" value="<?php echo $prevCustEmail; ?>" />
    

    Edit: For the server thing, the cookie hack may be the best. Here is another hack idea: You could modify your 500 server error page to have a button on it that says “go back to form”, which would only show up in the event that this $_POST data was just went. The button would actually be submitting an identical form where every is type=hidden. This data would then get transferred to the previous page and stuffed in as above.

    A third hack would be to load the page in an iframe, and have the success page jump out of the iframe. The server error would not do that. Then use Javascript onSubmit to detect that something has gone wrong, or just hope that the user notices nothing happened and clicks “submit” again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way that i can save data on each step in wizard
We have the requirement to take a form submission and save some data, then
I have a Django form that is working fine. I'd like to save the
I have the following jQuery code: $('.save').submit(function(e){ var formElement = $(this); var data =
What is the easiest way to save form data and retrieve it when the
Is there any way to save the state of vim settings with a document?
Is there any way to save my code folding in eclipse? It's horrible to
I'm wondering if there's a way to save window configurations across emacs sessions. I
Is there a one button way to save a screenshot directly to a file
Is there a way to get Eclipse to save the state of the project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.