You can use ajax
form submit and enable buttons inside the success callback. Assuming the id of your from is myForm
and your Add Slider
and Add Attchment
buttons have ids add-slider
and add-attachment
respectively.
$(document).ready(
$('#myform').on('beforeSubmit', function(event, jqXHR, settings) {
var form = $(this);
if(form.find('.has-error').length) {
return false;
}
$.ajax({
url: form.attr('action'),
type: 'post',
data: form.serialize(),
success: function(data) {
$('#add-slider, #add-attachment').prop('disabled', false);
}
});
return false;
}),
);