Skip to content

Commit

Permalink
Update radio.md
Browse files Browse the repository at this point in the history
Added Layout Radio Switcher information aswell as an exemple on how to use it on the bottom. Additionally Added JNo / JYes Option Labels for Styling with yes/no.
  • Loading branch information
marcorensch authored Oct 6, 2024
1 parent a8fcd42 commit 53d1a51
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The **radio** form field type provides radio buttons to select options. If the f
- **description** (optional) (translatable) is the [field description](../standard-form-field-attributes.md#description).
- **default** (optional) is the default password.
- **class** (optional) is a CSS class name for the HTML form field. If set to `class="btn-group btn-group-yesno"` will show coloured buttons.
- **layout** (optional) can be used to set a Layout for the switcher. Eg. if set to `layout="joomla.form.field.radio.switcher"` will use the Joomla Radio-Switcher Layout.

The XML `<field>` element must include one or more `<option>` elements which define the individual radio button items. The text between the `<option>` and `</option>` tags is shown as the label for the radio button and is a translatable string. The `<option>` tag takes the following argument:

Expand Down Expand Up @@ -59,10 +60,25 @@ Styling with yes/no values:
label="Select an option"
description=""
class="btn-group btn-group-yesno">
<option value="0">1</option>
<option value="1">2</option>
<option value="0">JNo</option>
<option value="1">JYes</option>
</field>
```

Styling with yes/no values as Switcher:

```xml
<field
name="myradiovalue"
type="radio"
default="0"
label="Select an option"
description=""
layout="joomla.form.field.radio.switcher">
<option value="0">JNo</option>
<option value="1">JYes</option>
</field>
```

## See also
* [List form field type](./list.md)
* [List form field type](./list.md)

0 comments on commit 53d1a51

Please sign in to comment.