permaculture playing cards*
The moose likes HTML, CSS and JavaScript and the fly likes Help reset/clear form data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Help reset/clear form data" Watch "Help reset/clear form data" New topic
Author

Help reset/clear form data

Manuel Zammarono
Greenhorn

Joined: Jun 28, 2011
Posts: 1
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..


[Thumbnail for help1.PNG]

[Thumbnail for help2.PNG]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help reset/clear form data
 
Similar Threads
form reset problem
reagarding jsp problem
multiple forms in JSP
How to Uncheck the checkbox
making all fields empty when i make new transaction