Forums Forums Search & Filter Pro Checked input, Ajax

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #18751

    Hi Ross,

    Really excited to be using this plugin again. Still love how it functions and looks on the back-end, and I think that our client will, too.

    Now for the issue that I’m having. I am using Advanced Custom Field selections in order to categorize my products on an eCommerce website. The Search Results are being loaded using Ajax, and are Bookmarkable. Both are working very well so far. The problem that I’ve run into is that the checkboxes are not receiving a “checked” attribute in the HTML upon selection. If I reload the search results page, then I see the “checked” states.

    Maybe this is more of a feature request, but I think that it’s unfortunate/incorrect that the plugin doesn’t update those checkboxes on selection. I can do this myself in jQuery right now, just thought that I would bring it up and see if maybe I’m missing something/did something wrong.

    Anyway, again, great plugin. It’s nice to use something that works so well.

    Ross Moderator
    #18798

    Hey Alex

    Thanks for the message.

    The default behaviour of checkboxes is as standard from a browser – you should not have to manually add checked attributes when a user interacts with a checkbox – otherwise every checkbox on the internet would require some custom JS to go with it to add remove this attribute.

    What are you trying to achieve specifically?

    If you are using jQuery, I always used to the use the $("selector").attr("checked") to test if it was checked but this is incorrect – these days we should be using prop – something like $("selector").prop("checked")

    Thanks

    Anonymous
    #18807

    Hi Ross,

    Right, well, that’s what I would have expected as well. Oddly enough, the checkboxes ARE getting the “checked” property, but it’s only on page reload. Not when I initially click on them. Before I added the jQuery to make this happen (and thanks for the tip, by the way), there was nothing that should have inhibited the “checked” attribute from being applied.

    Ross Moderator
    #18809

    Hey Alex

    Thats certainly odd, its not something I would think S&F would be inhibiting for example – have you tried to see how other checkboxes behave in the frontend of your theme? Try adding one to a custom template and see if the checked property works the same as in S&F?

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)