Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › No filter selected by default › Reply To: No filter selected by default
April 29, 2024 at 3:58 pm
#47980
Keymaster
It’s not that simple I’m afraid. The checkbox gets checked when the user clicks on the container “.asp_option” element.
An event handler is attached to it (native), which then changes the checkbox property to checked/unchecked, after that it fires the following event:
checkboxElement.dispatchEvent(new Event('asp_chbx_change'));
However you can attach to that event:
jQuery(function($){
let t;
t = setInterval(()=>{
if ( typeof WPD !== 'undefined' && typeof WPD.dom !== 'undefined' ) {
WPD.dom('input').on('asp_chbx_change', function(){
console.log('hey')
});;
}
}, 100);
});