Remembering inputs in a form when an error occurs.
Remembering inputs in a form when an error occurs.
Author
Discussion

Nic Jones

Original Poster:

7,190 posts

252 months

Monday 29th October 2007
quotequote all
Following on from my ASP issues I have one last question!

I have a form that when submitted carries out a validation process to ensure that the data inputted is of the right standard (ie email addresses contain an '@' etc) before writing to the database.

However, if the validation is unsuccessful and the form is displayed again with an error message on the field in question all other data entered disappears.

Can someone please advise how to get the previously inputted data to return to the screen so the user doesn't have to retype it please.

Thanks

GreenV8S

31,028 posts

316 months

Monday 29th October 2007
quotequote all
If you're doing server side validation then send back the 'error, try again' page with the fields initialised to the values submitted last time. If you're doing it client side then just don't perform the submit.