aspose file tools*
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 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help!  html:submit qustion" Watch "Help!  html:submit qustion" New topic
Author

Help! html:submit qustion

Bruce Sparo
Greenhorn

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"/>
</html:submit>


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

Joined: Jan 27, 2004
Posts: 32
Hello
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
Greenhorn

Joined: Jun 24, 2004
Posts: 9
Farouk,

Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help! html:submit qustion
 
Similar Threads
Alignment of button
more than one submit button and action
Page is not redirected in struts
CSS / Struts Button style problem
LookUpDispatchAction