lundi 8 novembre 2021

Set alert in chosen jQuery plugin

I am using jQuery chosen plugin to set status of a product. So I wanted to set an alert. Means when I set disabled option and click Add Item an alert() will show on top.Image of sample. I am not understanding what should I write in my if() condition. Here is my code where I sticked.

//Check status if user selected disabled option
        if($status == 'disabled'){
            alert("you select disabled Item");
                exit();
        }

I am not getting if my condition is right/wrong, cause this condition is not working. Please help

 $(document).ready(function(){
// Style the dropdown boxes. You need to explicitly set the width 
// in order to fix the dropdown box not visible issue when tab is hidden
$('.chosenSelect').chosen({ width: "95%"});
}

Code of script for working with chosen plugin

Aucun commentaire:

Enregistrer un commentaire