Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help reset/clear form data

 
Manuel Zammarono
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am newbie in JSP and I am having trouble with resetting or clearing data in form. Assuming I have 2 simple jsp pages, namely first.jsp and second.jsp



That's the sample of my codes for the reset button and submit button. I would like to key in some data in form(first.jsp) and foward/display it into another jsp(second.jsp) which I put edit button to go back for the editting process(go back to first.jsp). Supposely when I not key in any data, and press Submit button I will get something like in attachment help1.PNG which is most of them is null. When I key in data I will get something like in attachment help2.PNG.

When I want to edit(I pressed edit at second.jsp) and it does bring me back to first.jsp and it have all the data which I key-in earlier.

Now the problem is, when I click reset button(first.jsp) it does clear all the forms. But when I pressed sumbit button after pressing reset button, it still foward all the values which I key-in earlier. And I get something like in attachment help2.PNG even I did not key-in any data at all.

So what should I do to reset all values back to null/initial when Reset button is pressed.. I tried using javascript or some onclick methods but none work so far.

p/s: Sorry for my bad english..
help1.PNG
[Thumbnail for help1.PNG]
help2.PNG
[Thumbnail for help2.PNG]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic