Skip to content

input

Renders an <input> element with automatic value re-population from submitted form data.

For file uploads, use the {% upload %} tag instead.

Usage

liquid
{% input type: 'text', name: 'first_name', class: 'form-control', required: 'required' %}

Options

All standard HTML input attributes are supported, including data- attributes. Pass them as key/value pairs.

OptionDescription
typeInput type — text, email, number, checkbox etc. For file input use the custom upload tag.
nameField name. Used to auto-populate the value from submitted form data. When used within a submission form, this must align with a corresponding field in a Syngency model record.
idID attribute.
classCSS classes.
valueDefault value. Overridden automatically if a submitted value exists.
placeholderPlaceholder text.
requiredPass required: 'required' to mark the field as required.
data-*Any data- attributes are supported, e.g. data-foo: 'bar'.

WARNING

Attributes without values are ignored. Use required: 'required' rather than required alone.

Auto-population

When a name is set, the field value is automatically re-populated from submitted form data after a failed submission. This applies to both contact forms (via querystring.form.values) and submission forms (via form.values).