This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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: 61310
    
  66

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