{% if form %} {% if form.submittedSuccessfully %}
{{ successMessage }}
{% endif %} {% css formCss %} {{ form.renderTag }} {% if form.pages|length > 1 %} {% endif %} {% if form.hasErrors %}
{{ "There was an error submitting this form"|t('freeform') }} {% if form.errors|length %} {% endif %}
{% endif %} {% for row in form %}
{% for field in row %} {% set columnClass = "field freeform-column " ~ form.customAttributes.columnClass %} {% if field.type == "submit" %} {% set columnClass = columnClass ~ " freeform-column-content-align-" ~ field.position %} {% endif %}
{% set class = "freeform-input" %} {% if field.type in ["checkbox", "checkbox_group", "radio_group", "mailing_list", "dynamic_recipients"] %} {% set class = class %} {% elseif field.type == "submit" %} {% set class = class ~ " " %} {% else %} {% set class = class ~ " text" %} {% endif %} {% set labelClass = "freeform-label" ~ (field.inputOnly ? " freeform-input-only-label" : "") ~ (field.required ? " freeform-required" : "") %} {% set instructionsClass = "freeform-instructions" %} {% set errorClass = "freeform-errors" %} {% if field.type == "select" or (field.type == "dynamic_recipients" and field.showAsSelect) %} {{ field.renderLabel({ labelClass: labelClass }) }} {{ field.renderInstructions({ instructionsClass: instructionsClass }) }}
{{ field.renderInput({ class: class }) }}
{{ field.renderErrors({ errorClass: errorClass }) }} {% elseif field.type == "submit" %} {{ field.renderInput({ class: "btn submit" }) }} {% else %} {{ field.render({ class: class, labelClass: labelClass, errorClass: errorClass, instructionsClass: instructionsClass, }) }} {% endif %} {# FOR FREEFORM PAYMENTS #} {% if field.layoutRows is defined %} {% for layoutRow in field.layoutRows %}
{% for layoutField in layoutRow %}
{{ layoutField.render({ class: class, labelClass: labelClass, errorClass: errorClass, instructionsClass: instructionsClass, }) }}
{% endfor %}
{% endfor %} {% endif %}
{% endfor %}
{% endfor %} {{ form.renderClosingTag }} {% endif %}