This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mutiple form submission

 
Subhadeep biswas
Greenhorn
Posts: 14
Hibernate Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64184
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic