A newer version of

Freeform

is available.

Try Freeform 5 now →

User Guides

Parsing HTML in Field Options

If you like, you can enter basic HTML (<b>, <i>, <a>, etc) into Freeform field labels and option labels while inside the form builder. This is especially handy if you want to add emphasis to an option or add a link to an option (e.g. link a checkbox label for Terms & Conditions page).

Instructions

The demo and sample templates will likely handle the HTML in the form rendering automatically, but in cases where it doesn't, you may need to apply the raw Twig filter:















 




{{ field.renderLabel({
    labelClass: (field.required ? " required" : ""),
    instructionsClass: "help-block",
    errorClass: "help-block",
}) }}

{% for option in field.options %}
    <div class="checkbox">
        <label>
            <input type="checkbox"
                name="{{ field.handle }}[]"
                value="{{ option.value }}"
                {{ option.value in field.value ? "checked" : "" }}
            />
            {{ option.label|raw }}
        </label>
    </div>
{% endfor %}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18