<p>You should be using <code>forms.radioGroupField</code> instead of <code>forms.radioGroup</code>, just like you're using <code>forms.lightswitchField</code>.</p>

CC BY-SA 3.0
2015-06-19T04:48:29.883Z
2015-06-19T04:48:29.883Z
Brad Bell
<p>I am trying to learn how to create plugins using craft and am having a small problem.</p>

<p>On the templates/settings.html page I have the following code:</p>

<pre><code>{% import "_includes/forms" as forms %}

{{ forms.lightswitchField({
    label: "Lightswitch Label"|t,
    instructions: "Lightswith Instructions"|t,
    name: 'lightSwitchName',
    on: settings.lightSwitchName,
}) }}



{{ forms.radioGroup({
    label: "Radio Group Label"|t,
    instructions: "Radio Group Instructions"|t,
    name: 'radioGroupName',
    options:{ "option_1" : "option_1", "option_2" : "option_2"},
    value: settings.radioGroupName
}) }}
</code></pre>

<p>What is interesting is that on the settings page for this plugin (in the admin control panel) the label and instructions only show up for lightswitch field and not for the radio group.  Here is a screen shot:</p>

<p><img src="https://content.screencast.com/users/SEMCourses/folders/Jing/media/17547054-15e7-4b7b-aec2-ab25656ba297/2015-06-19_0202.png" alt="screenshot"></p>

<p>Am I doing something wrong?  Is there a way to display a title and instructions for a radiogroup?  If so, can someone please tell me how?</p>

<p>Thanks,</p>

<p>Moshe</p>

<plugin-development><lightswitch><settings>
Problems Displaying Label and Instructions in Forms
# Problems Displaying Label and Instructions in Forms

(Asked by: username_0 on 2015-06-18)

I am trying to learn how to create plugins using craft and am having a small problem.
On the templates/settings.html page I have the following code:
{% import "_includes/forms" as forms %}

{{ forms.lightswitchField({
    label: "Lightswitch Label"|t,
    instructions: "Lightswith Instructions"|t,
    name: 'lightSwitchName',
    on: settings.lightSwitchName,
}) }}



{{ forms.radioGroup({
    label: "Radio Group Label"|t,
    instructions: "Radio Group Instructions"|t,
    name: 'radioGroupName',
    options:{ "option_1" : "option_1", "option_2" : "option_2"},
    value: settings.radioGroupName
}) }}

What is interesting is that on the settings page for this plugin (in the admin control panel) the label and instructions only show up for lightswitch field and not for the radio group.  Here is a screen shot:

Am I doing something wrong?  Is there a way to display a title and instructions for a radiogroup?  If so, can someone please tell me how?
Thanks,
Moshe

**Tags:** plugin-development, lightswitch, settings

---

## 1 answers

### Answer by username_1 on 2015-06-19. Score: 2 | Accepted answer

You should be using `forms.radioGroupField` instead of `forms.radioGroup`, just like you're using `forms.lightswitchField`.


---

