Using Javascript, how to deactivate another button when the other button is currently selected and prevent overriding

When we clicked on the button and at a same time, If we want to disable the other or particular button disable,
By using JQuery method we can disable the button
for example
$(‘.remove-button’).prop(‘disabled’, true);
In this ‘.remove button’ is class name of the button
The Example is given as below

$('.approve-order-button').text('Processing...');
$('.remove-button').prop('disabled', true);
this.ApprovalModel.save(object, {
type: 'POST'
}).fail(function (e) {
let placeholder = jQuery('.alert-order-approval');
message = Utils.translate('Sorry! The Order is not approved');
let alert = self.alertMessage(message, 'error');
alert.show(placeholder, 6000);
$('.approve-order-button').text('Approve Order');
$('.remove-button').prop('disabled', false);

Thank you.

Leave a comment

Your email address will not be published. Required fields are marked *