You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by James Hays <ja...@mac.com> on 2003/08/04 17:57:03 UTC

Re: Best Practice - Handling Cancel Button in a Form

The only solution I've come up with so far is to place on onclick 
attribute on the submit button 'Cancel'  So, here is what it looks like.

<input TYPE="SUBMIT" VALUE="Return / Cancel" jwcid="cancelButton" 
onclick="form.onsubmit=null"/>

Hope this helps anyone with a similar issue.  If you have a better 
solution, please let us know.

James


James Hays wrote:

> Hello,
>
> I'm looking for a best practice here.  I'm wanting to have a Cancel 
> button inside my form which will not cause all of the components in 
> the form to fire off their setters.
> Currently, I have form with a listener and two Submit components.  One 
> called saveButton and one cancelButton.  The cancelButton defines a 
> new listener which calls cancelAction.  This in turn returns to my 
> Home page.  Both Submits cause the setters of the components to invoke.
>
> What am I missing here?
>
>
> Thanks.
>
> James
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>