[WEB4LIB] clearing forms that have non-blank defaults

Samuel Mcdonald smcdon at rci.rutgers.edu
Tue Feb 13 13:55:38 EST 2001


Hi:

Make a new 'reset' button and and have a function that
essentially 
sets the value of that fields content to ""
eg.
document.submitform.name.value = "";

do it for each field to clear all.

-Sam


On Tue, 13 Feb 2001, Kenneth Irwin wrote:

> Hi folks,
> 
> Is there a good way of clearing form <input type=text> fields that have
> initial values other than value="" ?
> The reset button will reset a form to the default value, but not clear
> fields that started out with a value.
> 
> For example, the following is a copy of the output from a search function:
> http://userpages.wittenberg.edu/kirwin/av-output.html
> Once a search is executed, a search with 0 results will load with the
> search terms re-input into the search fields so they can be modified. This
> is nice enough, but if the user decides to try a completely different
> search, one or more fields would have to be cleared.
> 
> It seems to me that there must be a way to use the JavaScript "onReset"
> event to clear the fields, but I haven't figured it out. Does anyone have a
> clue how this would work - either with JS or with some other tool?
> 
> Thanks
> Ken
> Ken Irwin	                            		kirwin at wittenberg.edu
> Reference/Electronic Resources Librarian	(937) 327-7594
> Thomas Library, Wittenberg University
> 

------------------------------------------------------------------------
Samuel J. McDonald                                smcdon at rci.rutgers.edu
Webmaster                              http://www.libraries.rutgers.edu/
Rutgers University Libraries                        Voice (732) 932-7505
Alexander Library, 169 College Ave., New Brunswick, NJ 08901-1163  



More information about the Web4lib mailing list