Often, you’ll want to prevent impatient users from clicking a submit button multiple times, as you can end up with multiple actions taking place, or object state can get in a bad way leading to errors. For this example we’ll assume you have a final Submit Order form that actually places the order, auth’s the credit card, etc…
You can’t simply disable the submit button onclick with ATG as typically the submit button is the input field that actually activates the handle method. I tried a bunch of things, before I was able to get something working, so I wanted to share that here.
Second, you need to move the input that calls the correct handle method out of the submit button and into a hidden form field:
<dsp:input bean=”CommitOrderFormHandler.commitOrder” value=”submit” type=”hidden”>
And that’s it.
Leave a Reply