This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

Reset button & Validation Error

Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a form "ModfyUserForm" with "Submit" button and a "Reset" button. The form is prepopulated depending on what user is selected from a dropdown list. When you edit a certain field in the form and before clikcing Submit you click Reset my previous data is loaded back in the form. But while modifying if any field(like emailaddress field) is empty I throw a Validation Error.
But after the Validation Error if I click the Reset button the old values are not retrieved and the form is not populated with the old data. Is there a way to make this...if could you please let me know.
Thanks in advance.
Posts: 14740
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reset restores fields with the values they had when the page was originally loaded. When you come back with validation errors, the data that you validated now become the original values. The values that you had before validation are lost. The only way you can restore the values you really wanted would be to change your reset button to a submit button and pull the original values back into the form fields on the server side. That is, instead of
<html:reset />
you would have
Poop goes in a willow feeder. Wipe with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!