It's not a secret anymore!
The moose likes HTML, CSS and JavaScript and the fly likes How to make it blank? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to make it blank?" Watch "How to make it blank?" New topic

How to make it blank?

Debashree Halder
Ranch Hand

Joined: Jul 27, 2005
Posts: 81
How to refresh all the text fields,textareas, checkboxes in jsp page?
Initially they should be blank.....only after selecting from some drop down combo box data is being populated in all the fields. But before even selecting something it is showing some data....which is not reqd.How I make it blank initially.

I am using this kind of format for data populating.


Debashree Halder<br />SCJP 1.5<br />Washington DC
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Is the data being set by your function when the page loads or is it being filled in by autocomplete form the browser. If it is autocomplete, then you can disable it by placeing autocomplete="off" in the form tag.

Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
There's also a jsp forum if you're iterested
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63353

Do a 'View source' on the page after it loads. If the form elements have value attributes to set the data into the elements, then this is a server-side issue.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Debashree Halder
Ranch Hand

Joined: Jul 27, 2005
Posts: 81
Are there any functions like refresh() or rest() in JavaScript calling which I can reset all the fields of the form?

Please let me know.

Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
You can call reset() on the form itself, but it will just reset the inputs to what they were when the page was received from the server.

I agree. Here's the link:
subject: How to make it blank?
It's not a secret anymore!