Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mutiple form submission

 
Subhadeep biswas
Greenhorn
Posts: 14
Hibernate Java Spring
  • 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
  • Likes 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: 65221
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic