File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Mutiple form submission Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Mutiple form submission" Watch "Mutiple form submission" New topic
Author

Mutiple form submission

Subhadeep biswas
Greenhorn

Joined: Apr 30, 2012
Posts: 14

i am unable to disable the button to avoid multiple form submission ..i have written code which is working on IE but neither on firefox nor on chrome

$(document).ready(function() {

$('#personalInformation').submit(function(){



$('#continueButton').attr("disabled", true);

});
});

in HTML BODY

<form:form method="post" action="${contextPath}/view/ActivationComponentController" modelAttribute="activationForm" id="personalInformation">

<button id="continueButton" type="submit" name="validateMsisdn" class="button sidePanel2 primaryButton">

</form:form>

Condition:- Spring form tag must be used
Button should be used.

Please help help help

Thanks in advance..
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Disabling a button has weird effects on forms, and one of those is the form may not submit. Some people like to hide the button instead of disabling it.

The real way to prevent multiple submissions is on the server and not on the client.

Eric

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60975
    
  65

Eric is exactly right. Even if you have client-side guards to prevent this, you still need code not he server to detect and prevent this condition as you can never be certain that the client-side guards will be used.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mutiple form submission