Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@apache.org Received: (qmail 68644 invoked from network); 12 Apr 2002 16:24:09 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Apr 2002 16:24:09 -0000 Received: (qmail 23963 invoked by uid 97); 12 Apr 2002 16:23:06 -0000 Delivered-To: qmlist-jakarta-archive-struts-user@jakarta.apache.org Received: (qmail 23919 invoked by uid 97); 12 Apr 2002 16:23:05 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 23847 invoked from network); 12 Apr 2002 16:23:03 -0000 X-Authentication-Warning: coltrane.crossley.org: jim set sender to jcrossley@ifleet.com using -f Sender: jim@coltrane.crossley.org To: "Struts Users Mailing List" , Rick Reumann Subject: Re: Re[4]: proper/best way to create a "true" reset after some validation comes back References: <126250409640.20020412094545@reumann.net> <188254391215.20020412105207@reumann.net> <97257297354.20020412114033@reumann.net> From: Jim Crossley Date: 12 Apr 2002 12:24:07 -0400 In-Reply-To: <97257297354.20020412114033@reumann.net> Message-ID: Lines: 125 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hmm. That smells like the behavior of the browser's reset button (what you get with ). Are you *sure* the correct javascript function is getting called? If you are, then I'm at a loss for what could be wrong. In the immortal words of every asshole developer out there, "It works for me." :-) Rick Reumann writes: > Still not working here, although not totally sure why. The javascript > works fine for resetting the fields the first time the jsp comes up, > but after it is submitted with some errors and the validation errors > come back, calling this reset function is not clearing all the fields. > It is only clearing fields that are newly typed. Any more insight to > why this would be happening? > > On Friday, April 12, 2002, 10:59:44 AM, Jim wrote: > > JC> I don't think so, Rick. The javascript effectively mimics a user > JC> manually clearing out all the fields on the form. Once the form > JC> is submitted, the new values (empty unless the user put something > JC> in after invoking resetForm) will populate the formbean prior to > JC> invoking validate. Upon failing validation, those same values > JC> will be presented to the user with the error message, if any. > > JC> Try it and see. > > JC> -- Jim > > JC> Rick Reumann writes: > > >> The problem (from what I can gather) using this javascript approach is > >> that it really isn't clearing out what is in memory. So for example > >> say you call this function and the form clears out but the user types > >> in something in the wrong format, when he now submits and gets back > >> the validation errors it will also include stuff filled in the form > >> that was there before this javascript function was called. I'm pretty > >> sure this is what would happen but I could be wrong. > >> > >> On Friday, April 12, 2002, 10:09:35 AM, Jim wrote: > >> > >> JC> Gross, but effective: > >> > >> JC> > >> > >> JC> -- Jim > >> > >> JC> Rick Reumann writes: > >> > >> >> If the user submits a form and some server side validation is done and > >> >> the jsp form returns to the user with some validation, what is the > >> >> best way to allow the user to clear the form and start over. Having a > >> >> button whill only clear new things they enter, and > >> >> refreshing is currently returning the same form with the same > >> >> validation errors. I was thinking maybe having a button labeled > >> >> "reset" but what it actually does is submit to an action that clears > >> >> out all the fields and then returns you? Is this a good way to do it, > >> >> or is there a better way with struts? > >> >> > >> >> Thanks for any feedback. > >> >> > >> >> > >> >> -- > >> >> > >> >> Rick > >> >> mailto:maillist@reumann.net > >> >> > >> >> "Why do people in ship mutinies always ask for 'better treatment'? I'd > >> >> ask for a pinball machine, because with all that rocking back and > >> >> forth you'd probably be able to get a lot of free games." > >> >> -Jack Handey > >> >> > >> >> > >> >> -- > >> >> To unsubscribe, e-mail: > >> >> For additional commands, e-mail: > >> > >> > >> > >> -- > >> > >> Rick > >> mailto:maillist@reumann.net > >> > >> "The difference between a man and a boy is, a boy wants to grow up to > >> be a fireman, but a man wants to grow up to be a giant monster > >> fireman." > >> -Jack Handey > >> > >> > >> -- > >> To unsubscribe, e-mail: > >> For additional commands, e-mail: > > > > -- > > Rick > mailto:maillist@reumann.net > > "There's nothing so tragic as seeing a family pulled apart by > something as simple as a pack of wolves." > -Jack Handey > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: -- Jim Crossley http://www.lads.com/~jim -- To unsubscribe, e-mail: For additional commands, e-mail: