3
In a Method POST form , when I click the button twice quickly it executes the submission twice.
Solutions with javascript or spring framework .
3
In a Method POST form , when I click the button twice quickly it executes the submission twice.
Solutions with javascript or spring framework .
10
Disable the button after the first click, because if the request delay the user will have the perception that the request was really sent, and can not send another.
$('form#id').submit( function( e ) {
$( this ).children( 'input[type=submit]' ).attr( 'disabled', 'disabled' );
e.preventDefault();
return false;
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form id="id">
<input type="submit"/>
</form>
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
Thanks for the feedback. It’s a good solution
– Jose Vieira Neto
@David, very good solution! It would be nice for you to edit the post by adding the code so that if the jsfiddle link breaks more people they can be helped :D
– Brunno
Okay, I’ve been edited, thanks for the tip.
– David Schrammel