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 6340133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:46:47+00:00 2026-05-24T19:46:47+00:00

Let’s say a user gets a page /form/ GET /form/ He then fills in

  • 0

Let’s say a user gets a page /form/

GET /form/

He then fills in the form and sends a post request

POST /form/

The server attempts to validate user input and determines input to be invalid.

Currently the history chain for the users is

  • GET /form/
  • POST /form/

Now the server redirects the user to the GET /form/ page so it can fill in the form again (with error messages).

His history looks like

  • GET /form/ with filled in form fields
  • GET /form/ without filed in form fields

How do I send the user back without the user losing the details he entered in his first form?

What techniques are there for redirecting users back to their GET /form/ page and not forcing them to re-enter their information.

Below is my express (node.js) specific server side code for this example.

The validation middleware:

validate().on("error", function _error(msg) {
    // store error message on request object
    req.flash(msg, validateUserMessage[msg]);
}).on("valid", function _valid() {
    // handle the rest of /POST/
    next();
}).on("invalid", function _invalid() {
    // redirect user back to last page, the /GET/ form
    res.redirect("back");
}).run(function _validateUsers(check, sanitize) {
    // validation logic.
}); 

The routing:

// GET /form/
app.get("/form", function _signUpView(req, res) {
    // render /form/
    res.render("auth/signup", req.flash());
});

// POST /form/
// validation middleware used here. 
app.post("/form", secure.validateUser, function _signUpCreate(req, res) {
    model.create(req.body, function _create() {
         // create thing in database
    });
});
  • 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-24T19:46:47+00:00Added an answer on May 24, 2026 at 7:46 pm

    I have decided to summarise the comments below into my answer:

    To me, there seems to be only two sure ways of doing this:

    1. Passing the user input parameters back from the server to the browser and repopulate the form either:

       a) Using a parameters object passed to the view and populating each field using your severside language

       b) Passing back a Json object and populating the form using loadJson

    2. Using HTML5 local storage – which also requires JavaScript

    If you do not persisit your data using either the server or JavaScript, then surely you are limiting yourself to relying on the browser – which is something you have no control over.

    Good luck – if you do find a solution then please post it as your answer as I would be very intersted to see how you succeeded.

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

Sidebar

Related Questions

Let's say on a page I have alot of this repeated: <div class=entry> <h4>Magic:</h4>
Let's say I can call a method like this: core::get() . What is the
Let's say I have an facebook application running using the JS SDK. First user
Let's say a user is visiting my app website for the first time, so
Let's say you create a wizard in an HTML form. One button goes back,
Let's say I have a user class with columns name and email: Class User
Let's say i have two tables in db: Car and Part. Car owns arbitrialy
Let’s say I have a number like 0x448 . In binary this is 0100
Let's say I have a 12-bit Analog to Digital Converter (4096 bins). And let's
Let's say I have a structure named vertex with a method that adds two

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.