Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

retaining data on a form upon submit  RSS feed

 
Fritz Largosa
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want my html/jsp form to retain its textfield data when the user hits the submit button. I want to do this so the user does not have to refill the whole form if he/she happens to type in the wrong data on one of the textfields.

What I am doing right now is saving each textfield data on a session before checking each textfield data for correctness. If all data the user enters is correct the data is saved to the DB. If one of the textfield's data is wrong, the user will need to refill the form Right now my forms refills all textfields from a session variable. Is there an easier way to retain textfield data? so the user does not have to retype all information back in, but only the textfield where wrong data has been entered?

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you are doing is essentailly correct except that I'm not sure why you feel the need to store the values in the session when they are readily available from the request.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!