David,

What you need to do is to create your own custom handling of "Reset".

In the case of your form, I would NOT use a <HTML:Reset>, instead make
a <HTML:SUBMIT> but have a javascript snippet that sets a value for a
hidden form field, lets call the hidden field "action" and the value
would be 'reset'.

Then in your LoginAction.java, check the value of the form's action
field. If the value is 'reset', reload the original values back from
the database.

As explained earlier, the first time you come into the page, the
values of the form fields are what you set either from a database or
from your default values in the struts-config.xml file. When changes
were made, submitted, and failed validation, the default values of
these fields are the errored values sent with the last form
submission. As you have seen, all the normal reset does is restore
those values to the defaults for the html page. So the first time you
get 'good' defaults and the second time you get 'bad' defaults. By
making your own custom 'reset' button you get more control over the
action.

You could try and fix the errored values for the user in the first
place, but that would get around telling them what fields were wrong
and why.

Hope this helps,

Brian

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

Reply via email to