I'm not an expert in jQuery - and I know this is easy - but I cannot find the solution for this.
I have a page with 10 alerts (cancel, confirm, resend..) - with 10 forms and 10 submit buttons.
How I can disable the submit button on submit form with a generic function ?
I know how I can disable 1 form.
$('form#id').submit(function(){
$(this).find(':input[type=submit]').prop('disabled', true);
});
but with this I need to write 10x - a function for each form...
$('.form').submit(function(){
$(this).find(':input[type=submit]').prop('disabled', true);
});
I try this but, didn't work..
I need a function to works for any form..
All forms are like this:
<form id="cancelform" action="cancel.asp">
<input type="hidden" name="codec" id="codec" value="121">
<button type="button" class="btn btn-danger bk-rd-off" data-dismiss="modal"><i class="fa fa-times"></i> NO</button>
<button type="submit" class="btn btn-success bg-success-800 bk-rd-off"><i class="fa fa-check"></i> YES</button>
</form>