This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes HOW TO CLEAR FORM FIELDS AFTER SUBMITTING? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HOW TO CLEAR FORM FIELDS AFTER SUBMITTING?" Watch "HOW TO CLEAR FORM FIELDS AFTER SUBMITTING?" New topic
Author

HOW TO CLEAR FORM FIELDS AFTER SUBMITTING?

Rui Ferns
Greenhorn

Joined: May 06, 2001
Posts: 24
Hi all,
Can anyone tell me hoe to clear form fields after clicking on the submit button.
I have fields which contain sensitive info. When the submit button is clicked the data is sent to another JSP. But how can I clear these fields after submitting?
Thanks
Rui
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Use a javascript function to loop through all the form fields in the onSubmit/onClick of the submit button. Have the function check for the type of form field and then set it to it's default value.

Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
OnSubmit of your Submit button call this Javascript fn
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HOW TO CLEAR FORM FIELDS AFTER SUBMITTING?
 
Similar Threads
Button value is not getting passed when submit button is disabled
from is getting submitted when 'Refresh' button is clicked
form is getting submitted when 'Refresh' button on the browser is clicked.
Checkbox issue
Avoiding form resubmission