Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

Text and button aligned with a two-column form

Started by Oona O'Neil 9 years ago · 1 replies · 690 views
9 years ago

I need an info and a button aligned with a two column form. I've added the text as a spacer, but not sure what to do next - is there a way to wrap a spacer and a button into a two column layout?

YAML
forms:
    contact_form:
        name: contact
        action: /home
        classes: contact__form__wrapper js-form-contact
        fields:

            columns:
                type: columns

                fields:

                        column1:
                            type: column
                            fields:

                                - name: name
                                  placeholder: Name
                                  type: text
                                  validate:
                                    required: true
                                  classes: contact__form__input
                                - name: email
                                  placeholder: Email
                                  type: email
                                  validate:
                                    required: true
                                  classes: contact__form__input

                        column2:
                            type: column
                            fields:

                                - name: message
                                  placeholder: Message
                                  type: textarea
                                  size: long
                                  validate:
                                    required: true
                                  classes: contact__form__input--lg

            text:
                type: spacer
                text: All the fields are required

        buttons:
            - type: submit
              value: Send message
              classes: button_dark

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1135 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 60 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 132 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 108 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 127 7 months ago