I have a "Categories" field in my section. I want to perform some JavaScript actions when a category is selected.
Is there any built-in event which will be triggered at that point?
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It only takes a minute to sign up.
Sign up to join this communityI have a "Categories" field in my section. I want to perform some JavaScript actions when a category is selected.
Is there any built-in event which will be triggered at that point?
Try something like this?
$("#fields-myCateogryField").data("elementSelect")
.on("selectElements", function(e){console.log(e);})
.on("removeElements", function(e){console.log(e);});