Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

reset value after page containing error message return

 
giang nguyen
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regarding Struts form, I have a form and a reset button on it.
The reset button works well when you haven't submitted the form.
But when you submited the form and the validate method return your form together with some error message on it, the reset method now cannot display original value before you submit the form.
Does any one know a solution to this problem so that the reset button work like when you validate using javascript ?
Any answer is welcome.
Thanks
 
Vijay S. Rathore
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Giang,
The purpose of reset funtion is to reset all the form elements to their initial state but not remove the form element values. Well you can simulate a reset and invoke a javascript to clear all form elements whenever reset is choosen.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!