struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Puneet Lakhina" <puneet.lakh...@gmail.com>
Subject Re: reset() method
Date Sun, 03 Sep 2006 09:12:50 GMT
On 9/1/06, Sonu S <sonu.in@gmail.com> wrote:
>
> Hi,
>
> I am using struts in my application. i am using reset and validation. i am
> not writing any validation method. i am using struts' validation
> framework.
> validation is working. reset also works fine in application if i enter
> some
> values in form  (text box) and press reset, it clears form values.
>
> but if i follow these steps, reset does not work
>
> 1) enter some values in form
> 2) click submit button
> 3) validation fails
> 4)  return to form
> 5) values are still in text box
> 6) here if i press reset button it does not reset the form values.  it
> calls
> reset method ( i have checked reset method is being called) but it does
> not
> reset the text box,
>
> i want to reset the form every time reset button is clicked.
>
>
> thank u
>
> There is a fundamental difference between reset and clear. reset button is
used to set all the values in a form to the values they were intially loaded
with, so when your validation fails you return back to your form with values
you enetered. So the reset button sets them back to those values. If what
you want is clear not reset, as suggested, you must implement a method in
javascript to achieve the same.


-- 
Puneet

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message