Reputation: 3402
I have a bootstrap accordion:
And I want to disable all input controls in inactive panels. To validate just active panel.
I have a function to detect active tab:
$(".panel").on("show.bs.collapse hide.bs.collapse", function(e) {
if (e.type=='show'){
console.log($(this));
} else {
}
});
But how to disable inputs in inactive tabs (PayPal in the case above)? Thanks!
Upvotes: 0
Views: 680
Reputation: 83
try something like this:
$('.accordion-body:not(.in) > .input-for-paypal').prop('disabled', true)
the content that is shown has the class .in, so negate it and you get the hidden accordion-body
Upvotes: 1