In a Method POST form, when I click the button twice it quickly executes the submission twice.
Solutions with javascript or with the spring framework.
In a Method POST form, when I click the button twice it quickly executes the submission twice.
Solutions with javascript or with the spring framework.
Disable the button after the first click, because if the request delays the user will have the perception that the request was actually sent, and can not send another request.
$('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><formid="id">
<input type="submit"/>
</form>