• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help reset/clear form data

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
reply
    Bookmark Topic Watch Topic
  • New Topic