You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ausias vives <au...@yahoo.co.uk> on 2005/06/01 10:30:09 UTC

Re: disable submit button when pressed

Hi,

The trick in this case is that you always call the
listener form method, cause I'm using a unique
submit/image per form, and I can assure you that it
works.

If you have more than one submit/image per form you
can use a hidden javascript parameter that will be
used as a discriminator by you form listener to
discover which submit/image was pressed, it works well
for me too. Maybe it's not the better or cleaner
solution but has solved my big problems with
re-submitting forms.

Hope this clarifies...


--- Paul Ferraro <pm...@columbia.edu> wrote:

> Correct me if I'm wrong, but if you disable the
> submit/image button 
> before submitting the form, then the submit's value
> (or image submit's 
> coordinates) will not be submitted as a form value. 
> Since Tapestry 
> relies on these values to determine which
> submit/image button was 
> clicked, then the submit/image button's listener
> will never be invoked.
> 
> Paul
> 
> ausias vives wrote:
> 
> >Hi,
> >
> >I've found that the easier solution to this problem
> is
> >that any button that could perform a submit
> operation
> >should be wrapped by a form and thus be the unique
> >submit button of the form. Then add the code:
> >
> ><input name="search" id="search" type="image"
>
>onClick="this.disabled=true;document.forms[0].submit()"
> >src="images/search.gif" border="0">
> >
> >where 'forms[0]' should be changed to whatever your
> >form  number is.
> >
> >In case you must have more than one submit button
> in
> >the same form I came with a similar solution. If
> >someone is interested... just ask.
> >
> >Hope it helps,   
> >
> >
> >--- Javier Sanchez <ja...@gmail.com>
> wrote:
> >
> >  
> >
> >>Actually, that problem is not present in Firefox. 
> >>Try it.  However,
> >>MS IE has this annoying behaviour.
> >>
> >>    
> >>
> >>>WHile I can take care of preventing double
> submits
> >>>      
> >>>
> >>on the server, ...
> >>
> >>I am wondering how can you avoid double submits on
> >>the server side. 
> >>Are you modifying Tapestry's Engine?
> >>
> >>JAVIER SANCHEZ.
> >>
> >>On 5/30/05, phillip rhodes <rh...@yahoo.com>
> >>wrote:
> >>    
> >>
> >>>I figured that...
> >>>
> >>>But I am hoping that a magician already performed
> >>>      
> >>>
> >>that
> >>    
> >>
> >>>trick and could give me a few pointers.
> >>>
> >>>
> >>>--- Geoff Longman <gl...@gmail.com> wrote:
> >>>      
> >>>
> >>>>you need to do some javascript magic on the
> >>>>        
> >>>>
> >>client
> >>    
> >>
> >>>>side to prevent resubmission
> >>>>
> >>>>Geoff
> >>>>
> >>>>On 5/30/05, phillip rhodes <rh...@yahoo.com>
> >>>>wrote:
> >>>>        
> >>>>
> >>>>>When someone submits the "Place Order" on the
> >>>>>          
> >>>>>
> >>>>shopping
> >>>>        
> >>>>
> >>>>>cart confirmation page to place an order, I
> >>>>>          
> >>>>>
> >>would
> >>    
> >>
> >>>>like
> >>>>        
> >>>>
> >>>>>to disable the submit button (client side) so
> >>>>>          
> >>>>>
> >>as
> >>    
> >>
> >>>>to
> >>>>        
> >>>>
> >>>>>prevent resubmissions of the form.  WHile I
> >>>>>          
> >>>>>
> >>can
> >>    
> >>
> >>>>take
> >>>>        
> >>>>
> >>>>>care of preventing double submits on the
> >>>>>          
> >>>>>
> >>server,
> >>    
> >>
> >>>>the
> >>>>        
> >>>>
> >>>>>person who double submits would see a "Double
> >>>>>          
> >>>>>
> >>>>submit
> >>>>        
> >>>>
> >>>>>error page" and not the order receipt page.
> >>>>>
> >>>>>I see that the submit component has a disabled
> >>>>>property, but this is something that is set on
> >>>>>          
> >>>>>
> >>the
> >>    
> >>
> >>>>>server side and is not suitable for my needs.
> >>>>>
> >>>>>Thanks for your thoughts.
> >>>>>Anyone ready for the most cool cart ever
> >>>>>          
> >>>>>
> >>written
> >>    
> >>
> >>>>and
> >>>>        
> >>>>
> >>>>>in tapestry;)
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>          
> >>>>>
>
>---------------------------------------------------------------------
> >  
> >
> >>>>>To unsubscribe, e-mail:
> >>>>>          
> >>>>>
> >>>>tapestry-user-unsubscribe@jakarta.apache.org
> >>>>        
> >>>>
> >>>>>For additional commands, e-mail:
> >>>>>          
> >>>>>
> >>>>tapestry-user-help@jakarta.apache.org
> >>>>        
> >>>>
> >>>>>          
> >>>>>
> >>>>        
> >>>>
>
>---------------------------------------------------------------------
> >  
> >
> >>>>To unsubscribe, e-mail:
> >>>>tapestry-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail:
> 
=== message truncated ===



	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org