Hi folks,
Three days until iteration deadline, and I have a frustrating bug! It's almost textbook - I have a simple logon page (username/password) which includes a <html:reset> button which works nicely ... unless I press 'submit' with known bad input and come back to the form with Validation errors.
In that case the user can clearly see their input is somehow bad, thanks to the message, but when I click 'reset' this time, it does nothing? The fields continue to show the bad values.
I've only been using Struts a few days, and this feels like a FAQ, but I've not found an answer anywhere. I've a notion the values it's resetting too are actually the bad ones still held in the dyna bean, but I'm not sure how to correct that.
Any ideas? Please? What is the obvious thing I'm missing?
"reset" means "reset this form to the values it had when the page loaded."
When a page is drawn after validation fails, the initial values are set (not blank) so reset reverts to them rather than clearing the page.
Personally, I think reset buttons are almost never called for; I know I've been bitten a few times by accidentally clicking "reset" (which people usually put too close to "submit") and had to refill a form.
If what you want is to clear out all the fields, then either don't use the Struts form tags (which will mean that fields are not refilled after validation) or write a javascript handler for a <button> tag which sets the value of the form fields to blank. But for a typical two field login form, is "reset" even necessary?
Joe
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]