Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resetting Values in JSP Page

 
Deepak Chawla
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have JSP form Page and i want to reset values in form

[edit:reformated code so easier to read]

When i try to click on Reset , it only reset value fromtextarea which is labeled as "Notes/issues/open items", not from other fields. I don't know why. can anyone please help

[ December 19, 2003: Message edited by: Eric Pascarello ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34422
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak,
Your code works for me. What browser are you using. The code resets the fields (to empty) and checks the check box.
 
S Chandra Mohan
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
can u pls give the html output, which will be easier to check.
 
Deepak Chawla
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using IE 5.5
This is my HTML output

[edited: Reformatted Code So easier to read]
[ December 19, 2003: Message edited by: Eric Pascarello ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
an if statment in javascript uses == not =
Bear, bump this to the javascript forum since this is not a jsp problem...
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reset button only clears the data to what was orginally there when the page loaded. So if you are placing values into the fields from the jsp page, then that is what is going to show.
If you want to get rid of that then yo need to have a function hat loops through the elements and clears them.
Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the HTML/Javascript forum.
bear
 
S Chandra Mohan
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
is your problem solved ?
I tried the code, its giving javascript error.
Will check out
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic