File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Help!  html:submit qustion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help!  html:submit qustion" Watch "Help!  html:submit qustion" New topic

Help! html:submit qustion

Bruce Sparo

Joined: Jun 24, 2004
Posts: 9
New to struts so your help would be GREATLY APPRECIATED!

Have a html:submit tag. If the user clicks it twice the order goes through twice. What's the simpliest way to only allow it to be processed once.

Code can not be changed.

<html:submit property="subAction"><bean:message key="[button_text]order_checkout2.placeorder"/>

If I haven't already said it... THANKS for responding.
Farouk Sherefudheen
Ranch Hand

Joined: Jan 27, 2004
Posts: 32
The best way is to use javascript to stop the request getting into the server

// Prevent double submit of forms

var isFormSubmitted = false;

function registerSubmit() {
if (isFormSubmitted){
return false;
}else {
if (document.all) {
for (var i=0;i < document.all.length; i++)
document.all(i).style.cursor = 'wait';

isFormSubmitted = true;

return true;


function setCursor() {
Bruce Sparo

Joined: Jun 24, 2004
Posts: 9

Thank you.
I agree. Here's the link:
subject: Help! html:submit qustion
It's not a secret anymore!