• Resolved Marc

    (@marcwp7)


    Hey there!

    I need to handle the Checkboxes filter through jQuery or JavaScript.
    I have been able to change a Checkbox to checked or unchecked, and visually it displays correctly, but nothing changes in the results and nothing happens.

    If I click with the mouse everything works fine.

    I have tried these ways:
    $(‘input[id=”1categoryset_24″]’).prop(‘checked’, false);
    $(‘input[id=”1categoryset_24″]’).click();
    $(‘input[id=”1categoryset_24″]’).change();

    An image showing the situation: https://rewebs.xyz/sites/AjaxSearchLite.jpg

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    It won’t work that way, because the plugin does not use jQuery event listeners but native ES6, as well as the event name is custom.

    You can use either native javascript to trigger, or our custom made library which is included (works similar to jQuery), like so:

    WPD.dom("input[id='1categoryset_24']").trigger('asl_chbx_change')

    That should do the trick 🙂

    All the best,
    Ernest

    Thread Starter Marc

    (@marcwp7)

    Yes, that works!

    I just clarify that your line applies the actions according to the state of the checkbox (true/false), so it is necesary to make the change in the checkbox first, e.g. $(‘input[id=”1categoryset_24″]’).prop(‘checked’, true);

    Thanks a lot @wpdreams !

    Plugin Author wpdreams

    (@wpdreams)

    Great 🙂 You are very welcome!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Filter checkbox does not execute change’ is closed to new replies.