Making Cascade in Blocks Mandatory

Modified on Fri, Feb 9, 2018 at 8:30 AM

To make cascade function mandatory in blocks add this code to the bootstrap layout section of your block product, below the layout area. In the main layout section.

<div class="col-md-12">

layout area here........

</div

<script>
jQuery('#btnPrev').on('mousedown', function(){
var product = jQuery('select')[0].value;
if(!product){
alert("Product is empty");
jQuery('#btnPrev').attr('disabled',true);
}else{
jQuery('#btnPrev').removeAttr('disabled');
}
})
$(document).ready(function() {
$(document).on('change', jQuery(jQuery('select')[0]), function(){
var product = jQuery('select')[0].value;
if(product){
jQuery('#btnPrev').removeAttr('disabled');
}else{ alert("Product is empty");
jQuery('#btnPrev').attr('disabled',true);}})
});

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article