Answers.Body: <p>I'm not sure how to do a 3 way toggle with radio boxes, it might involve writing your own JS... but for the checkbox toggle it's pretty straight forward :)</p>
  
  <pre><code>{{ forms.checkboxField({
      ...
      toggle : 'toggleThis'
  }) }}
  
  &lt;div id="toggleThis" {% if settings.eventClickDestination is not defined or not settings.eventClickDestination %} class="hidden"{% endif %}&gt;
    //.. Form input goes in here
  &lt;/div&gt;
  </code></pre>
  
  <p>Craft will then take care of the toggling for you when the box is checked/unchecked</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-29T16:20:21.117Z
Answers.Text: Thank you, Alec. Where does the `<div id="toggleThis"` go?
Answers.UserDisplayName: kr37
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-29T16:23:16.320Z
Answers.Text: Wherever in your template you want the field to appear :)
Answers.UserDisplayName: Alec Ritson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-29T14:44:56.447Z
Answers.LastActivityDate: 2015-05-29T14:44:56.447Z
Answers.UserDisplayName: Alec Ritson
Body: <p><a href="https://craftcms.stackexchange.com/questions/5067/how-to-use-plugin-settings">This answer</a> has given me most of what I need, but I'd like to hide certain settings based on the status of other settings. CP seems to have nice functionality built in for conditionally hiding/showing parameters. For example, when changing a field from Rich Text to Plain Text, several options disappear.</p>
  
  <p>In this case, only if the preceding checkbox is checked do I want it to give an input field for the category field handle.</p>
  
  <p>Here is my /craft/plugins/calendar37/templates/_settings.html file:</p>
  
  <pre><code>{% import "_includes/forms" as forms %}
  
  {{ forms.checkBox({
          label: "Event Hyperlinking"|t,
          id: 'eventClickDestination',
          name: 'eventClickDestination',
          instructions: "If checked, clicking on an event goes to Category page. Otherwise, unchecked it will go an Entry page"|t,
          value: settings.eventClickDestination,
          errors: settings.getErrors('eventClickDestination')
      })
  }}
  
  {{ forms.textField({
          label: "Category Field's Handle"|t,
          id: 'categoryFieldHandle',
          name: 'categoryFieldHandle',
          instructions: ""|t,
          value: settings.categoryFieldHandle,
          errors: settings.getErrors('categoryFieldHandle')
      }) 
  }}
  </code></pre>
  
  <p>Note, I'd like to work out similar functionality with a 3-part radio button, but haven't figured out how to do radio buttons yet.</p>
  
  <p>Thank you!</p>
  
Tags: <plugin-development><settings>
Title: How to conditionally hide particular plugin settings?
ThreadText: # How to conditionally hide particular plugin settings?
  
  (Asked by: username_0 on 2015-05-29)
  
  [This answer](https://craftcms.stackexchange.com/questions/5067/how-to-use-plugin-settings) has given me most of what I need, but I'd like to hide certain settings based on the status of other settings. CP seems to have nice functionality built in for conditionally hiding/showing parameters. For example, when changing a field from Rich Text to Plain Text, several options disappear.
  
  In this case, only if the preceding checkbox is checked do I want it to give an input field for the category field handle.
  
  Here is my /craft/plugins/calendar37/templates/\_settings.html file:
  
  ```
  {% import "_includes/forms" as forms %}
  
  {{ forms.checkBox({
          label: "Event Hyperlinking"|t,
          id: 'eventClickDestination',
          name: 'eventClickDestination',
          instructions: "If checked, clicking on an event goes to Category page. Otherwise, unchecked it will go an Entry page"|t,
          value: settings.eventClickDestination,
          errors: settings.getErrors('eventClickDestination')
      })
  }}
  
  {{ forms.textField({
          label: "Category Field's Handle"|t,
          id: 'categoryFieldHandle',
          name: 'categoryFieldHandle',
          instructions: ""|t,
          value: settings.categoryFieldHandle,
          errors: settings.getErrors('categoryFieldHandle')
      }) 
  }}
  
  ```
  
  Note, I'd like to work out similar functionality with a 3-part radio button, but haven't figured out how to do radio buttons yet.
  
  Thank you!
  
  **Tags:** plugin-development, settings
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-05-29. Score: 2 | Accepted answer
  
  I'm not sure how to do a 3 way toggle with radio boxes, it might involve writing your own JS... but for the checkbox toggle it's pretty straight forward :)
  
  ```
  {{ forms.checkboxField({
      ...
      toggle : 'toggleThis'
  }) }}
  
  <div id="toggleThis" {% if settings.eventClickDestination is not defined or not settings.eventClickDestination %} class="hidden"{% endif %}>
    //.. Form input goes in here
  </div>
  
  ```
  
  Craft will then take care of the toggling for you when the box is checked/unchecked
  
  > **Comments:**
  > **username_0**: Thank you, username_1. Where does the `<div id="toggleThis"` go?  
  > **username_1**: Wherever in your template you want the field to appear :)  
  
  ---
  
  