Welcome Guest, Not a member yet? Register   Sign In
javascript related - Form is cleared when user presses back button

I am able to pass the variables back and forth
between windows(forms in the main and popup windows).
That is not the problem.
Problem is
After the pop-up form comes up user enters the value and submits
inside the popup and the value is successfully populated in the main form.
Now when the main form is submitted and verified sometimes there are some errors so, the users are instructed to go back and fix them. When user clicks the BACK button, all the entries in the main form are cleared.

How do we avoid that?


Can you give a URL to your form? I don't fully understand the problem.

Very Good


Why are you forcing the user to press the back button. I read that as saying you literally show them a screen that says "you had errors. go back". Please correct me if I misunderstood.

The way to fix this is to take the POST information that you obviously had in order to validate/check for errors, and use that information to repopulate the form WITH the error message... no need for a back button whatsoever. If you are using the form validation library then the re-population is even easier to perform.

I second TheFuzzyOne in asking for at the least a url to your form.

I'd also suggest taking the time to do front-end validation if you're not already, keep them from submitting until you have assured the least amount of errors possible.

Theme © iAndrew 2016 - Forum software by © MyBB