Dynamic Radio is a form tag added by Contact Form 7 – Dynamic Text Extension (DTX) that creates a group of <input type="radio"> form fields for forms created with Contact Form 7. It expands upon Contact Form 7’s radio form tag, accepting all of the options it does, along with these additional options introduced by DTX:
| Option | Description | Example |
|---|---|---|
| Dynamic options | Set a dynamic options for the radio buttons. The value(s) are shown in the form tag between quotes. It can be static text or a shortcode. If static text, use one option per line (each option is shown in the form tag between quotes, in order). Can define static options as just the option or as key/value pairs using pipes ({option value} | {option label}).If shortcode, it must return a JSON string of key/value pairs. Alternatively, it must return valid radio button HTML that can override the other options regarding which radio button is checked or by default. You can use a combination of static values and shortcodes, both as individual options or to return the value or label of an option. | |
| Selected Default | Optionally define the radio button that is checked by default. If options use key/value pairs, only define the key here. Can be static text or a shortcode. If using static text with spaces or special characters, or using a shortcode with parameters, the value of the default attribute should be encoded like the dynamic placeholder. | This last example uses CF7_GET key=’foo’ to define the radio button that should be checked on page load |
| Reverse | By default, the radio button comes first followed by it’s label text. By adding the label_first option, you can reverse them so the label text comes first followed by the radio button. | [dynamic_radio inputname label_first] |
| Label | Wrap each radio button and it’s label text with a <label> element. | [dynamic_radio inputname use_label_element] |
| Id attribute | Sets the id attribute of the wrapper element. | [dynamic_radio inputname id:foo] |
| Class attribute | Adds to the class attribute of the wrapper element. To set two or more classes, you can use multiple class: option. | [dynamic_radio inputname class:bar][dynamic_radio inputname class:hello class:world] |
| Read only attribute | Sets the readonly attribute to the input elements to prevent users from editing them. | [dynamic_radio inputname readonly] |
| Cache Compatible | Enable cache compatibility mode for this field | [dynamic_radio inputname dtx_pageload] |
These settings are easily configurable using the form-tag generator.

The dynamic_radio form tag was introduced in version 4.0.0 of the Contact Form 7 โ Dynamic Text Extension WordPress plugin.