1

Can we render some particular field from our FreeForm plugin ?

If yes, how can we achieve it ?

1 Answer 1

1

To pull an individual field from a form, use the form.get("myFieldHandle") method.

Simple example using the field.render() method:

{% set form = craft.freeform.form("myFormHandle") %}

{{ form.get("firstName").render() }}

Or a more custom example:

{% set form = craft.freeform.form("myFormHandle") %}
{% set firstName = form.get("firstName") %}

<label>{{ firstName.label }}</label>
<input name="{{ firstName.handle }}" value="{{ firstName.value }}" />
{{ firstName.renderErrors() }}

Examples from Freeform documentation

Note from the Freeform's docs:

When using with HTML blocks or Submit buttons, use the hash value provided in property editor in Composer as the handle. Example code would look like: {{ form.get('Ajx7jNxXL').render }}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.