Skip to content

Commit

Permalink
Sync with 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
HLeithner committed Oct 18, 2024
1 parent 53d1a51 commit f28f88d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs/general-concepts/forms-fields/standard-fields/radio.md
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,8 +60,23 @@ 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>
```

Expand Down

0 comments on commit f28f88d

Please sign in to comment.