Skip Navigation

[Resolved] make it possible for only 1 radio button to be checked at a time

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 1 voice.

Last updated by Ido Angel 6 years, 7 months ago.

Author
Posts
#760373

hey,

I have a search with 2 post types - posts, and events.
I am filtering categories in each cpt, using radio buttons.

page results should show only 1 category (from posts it can be either articles, videos, audio. from events it can be courses or retreats).

thing is, since they are 2 different cpts, once i press "videos" (for example) and then press "courses" (for example), both radio buttons are marked checked and results are not showing properly.

I want to be able to press only 1 radio button in the page, so that if i press "videos" it will show videos, and if i later press "retreats" it will show only retreats.

i tried changing the relationship between filters to "OR" instead of "AND", but that didn't work.

Page is here:

hidden link

It's in hebrew, but all radios (the appear as checkboxes, but they are radios) except the 2 leftmost are posts. the 2 leftmost are events.

thanks!

#760523

lol that was quick 🙂

i added this:

$("[class=js-wpv-filter-trigger]").on("click",function(){

    $("[class=js-wpv-filter-trigger]").prop('checked', false)
    $(this).prop('checked', true)

});

and it worked!
hope this helps others somehow.