[Seaside] Disable a submit button

Julian Fitzell julian at beta4.com
Thu Jul 24 12:00:12 CEST 2003


Nevin Pratt wrote:
> I need to use Javascript to disable the submit button after it has been 
> clicked.  But, as I understand it,  the Javascript that does this would 
> need to know the button name, and the button name is dynamically 
> assigned by Seaside.
> 
> What is happening on my Checkout page is, after hitting the Payment 
> Submit button, the user is occasionally hitting the "Back" button on the 
> browser, then looking at stuff, then hitting the "Forward" button, and 
> then clicking the Payment Submit button again.  This is resulting in 
> multiple charges (I'm manually correcting them for now, so the customer 
> doesn't see this error).  So, I need to disable the Payment button once 
> it has been clicked (and *without* the page having to be re-rendered or 
> reloaded).
> 
> Anybody know how to do that?

Can't you just put that page in a seaside transaction?  Then after they 
click the button, even if they go back and click on the button, it won't 
do anything - they'll get redirected to the most recent page in the 
session again.  This is assuming you are taking the approach that you 
discussed of doing the payment submission server-to-server, rather than 
having the user submit a form to to the payment site, of course.

Julian



More information about the Seaside mailing list