Title: Radio button checked
Last modified: August 24, 2016

---

# Radio button checked

 *  [Budolfsen](https://wordpress.org/support/users/budolfsen/)
 * (@budolfsen)
 * [11 years ago](https://wordpress.org/support/topic/radio-button-checked/)
 * Hi
 * I am using your plugin to create a search form and it works like a charm – but
   now I have a little question.
 * In the search form I have a radio button to search in the categories (it is set
   to not in)
 * Category 1 and category 2
 * Is it possible to always have category 2 checked so that the user have to make
   a choice if he doesn’t want the button checked….?
 * [https://wordpress.org/plugins/ultimate-wp-query-search-filter/](https://wordpress.org/plugins/ultimate-wp-query-search-filter/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [Budolfsen](https://wordpress.org/support/users/budolfsen/)
 * (@budolfsen)
 * [11 years ago](https://wordpress.org/support/topic/radio-button-checked/#post-6167772)
 * Update to the above question.
 * Is it possible if you’ve excluded a category in one option to include it in another
   option.
 * Eks.:
 * I have as above two categories but in my search form
 * I want only to search in category A
    – but I need to give the user the option
   of adding Category B by checking a checkbox
 * Is that possible?
 * Hope you can answer both questions…..
 *  Plugin Author [TC.K](https://wordpress.org/support/users/wp_dummy/)
 * (@wp_dummy)
 * [11 years ago](https://wordpress.org/support/topic/radio-button-checked/#post-6167837)
 * > 1. Is it possible to always have category 2 checked so that the user have to
   > make a choice if he doesn’t want the button checked….?
 * There are two ways, if you want fast and easier method, use js to do. There is
   an unique id for each of the input, so find the id for Category 2 (by using inspect
   element perhaps), you can bind it to the js script. eg:
 *     ```
       jQuery(document).ready(function($) {
         $('#tradio-1-2').attr('checked', true); //assume #tradio-1-2 is the id of the radio input.
       });
       ```
   
 * > 2. I want only to search in category A
   >  – but I need to give the user the option
   > of adding Category B by checking a checkbox
 * Not sure what you mean. But dynamic content (like adding category B when checking
   checkbox), always require js. If you fluent in js script, then yes, it can be
   done.
 *  Thread Starter [Budolfsen](https://wordpress.org/support/users/budolfsen/)
 * (@budolfsen)
 * [11 years ago](https://wordpress.org/support/topic/radio-button-checked/#post-6167843)
 * Hi
 * Thanks for the replies – the first option worked like a charm – but unfortunately
   it wasn’t what I need at this time.
 * What I hope to achieve is to exclude category B from category dropdown(Have done
   that in your plugin)
 * Now I want a checkbox so the user can activate the excluded category B to the
   search.
 * i am not fluent into the js – so I can’t figure out how to include the excluded
   category – I guess it has something to do with if statements….
 *  Plugin Author [TC.K](https://wordpress.org/support/users/wp_dummy/)
 * (@wp_dummy)
 * [11 years ago](https://wordpress.org/support/topic/radio-button-checked/#post-6167891)
 * > Now I want a checkbox so the user can activate the excluded category B to the
   > search.
 * Since you already excluded it, why you want to exclude this from the search??
 *  Thread Starter [Budolfsen](https://wordpress.org/support/users/budolfsen/)
 * (@budolfsen)
 * [11 years ago](https://wordpress.org/support/topic/radio-button-checked/#post-6167899)
 * I don’t know if the exclude from search is the right way to this but I have tried
   in, not in and none of them worked for me.
 * When a user choose from the drop down all – if I don’t exclude nostalgi from 
   the search these will show in the result – and that I don’t I want the user to
   active select that he wants the nostalgi catagory activated….
 * I had hoped I could do this with some js and just make an if statement and some
   work around – but I can’t get it to work….
 * Maybe you have tried or seen a better method to do this using your search form….
 *  Plugin Author [TC.K](https://wordpress.org/support/users/wp_dummy/)
 * (@wp_dummy)
 * [11 years ago](https://wordpress.org/support/topic/radio-button-checked/#post-6167914)
 * There are a _Exclude the term from being searched_ under the exclude term id.
   Did you try to check it?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Radio button checked’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ultimate-wp-query-search-filter_fcfcfc.
   svg)
 * [Ultimate WP Query Search Filter](https://wordpress.org/plugins/ultimate-wp-query-search-filter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-wp-query-search-filter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-wp-query-search-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-wp-query-search-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-wp-query-search-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-wp-query-search-filter/reviews/)

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [radio button](https://wordpress.org/support/topic-tag/radio-button/)

 * 6 replies
 * 2 participants
 * Last reply from: [TC.K](https://wordpress.org/support/users/wp_dummy/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/radio-button-checked/#post-6167914)
 * Status: not resolved