On Monday 29 November 2004 10:15, aris wrote:
> Instead of a reset you could use a simple button and the related onClick
> event to call a javascript that sets all field to "".
> What do you think about this "workaround"?
> Take note that it isn't an expected behaviour for a reset button. I suggest
> you to name such a button with a value different from "reset". What do you
> think about "wipe" or "erase"?
> Bye,
> aris.
>
> ----- Original Message -----
> From: "O. Oke" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, November 29, 2004 3:01 PM
> Subject: Reset button does not clear JSP fields
>
> > Please help!
> >
> > Background
> > ==========
> > I retrieve data from the database, copy the data into
> > an Action Form, the data is then automatically entered
> > into corresponding fields.
> >
> >
> > After viewing the data, I want the RESET button to
> > empty all fields whenever it is clicked.  Presently,


Agreed, Reset sets the form values back to their "default" values - if your 
tag is <INPUT type=xx name=yy value="zz">, then the default value is going to 
be "zz".  The simplest way to do what you want is either to create the tags 
with blank values, and have javascript that iterates through the form fields 
and sets the values, or create the tags with the defaults you want and have 
the javascript set their "...defaultValue='' "

I don't think you can do it without Javascript, because defaultValue is a DOM 
property not a tag attribute .
-- 
derek

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to