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

3 pages (or color section) form with forms plugin

Solved by Sergey Serebrennikov View solution

Started by Sergey Serebrennikov 8 years ago · 2 replies · 994 views
8 years ago

Is there a clean way to create a form with three pages (or color section) through a forms plugin? How to wrap a group of fields in the container with id="a", "b", "c". For example, I create a form template. How do I display specific fields in these containers? This is not a question of transferring data between pages, we are just showing part of the form code (id="a", "b", "c".) using CSS and JS. This may not be a page, such as the background color for the form section.

HTML
<div id="1">
    <div id="a">
        <div class="row">
            <div class="col-sm-6 mb-4">
            </div>
            <div class="col-sm-6 mb-4">
            </div>
        </div>
        <div>
        </div>
        <div>
        </div>
        <div class="row">
            <div class="col-sm-6 mb-4">
            </div>
            <div class="col-sm-6 mb-4">
            </div>
        </div>
    </div>
    <div id="b" style="display: none;">
        <div class="row">
            <div class="col-sm-6 mb-4">
            </div>
            <div class="col-sm-6 mb-4">
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6 mb-4">
            </div>
            <div class="col-sm-6 mb-4">
            </div>
        </div>
        <div>
        </div>
    </div>
    <div id="c" style="display: none;">
        <div>
        </div>
        <div>
        </div>
        <div>
        </div>
    </div>
</div>
last edited 11/03/18 by Sergey Serebrennikov
8 years ago Solution

The issue was solved with the help of "Columns" and "Column" fields. Found them in the Fields folder of plugin. It is strange that they are not in the documentation for the Frontend Forms. The "id" tag is added by editing the Columns field template.

👍 1
6 years ago

For anyone wanting more info, I posted a reply on a similar question, with an example on using columns and column (First part of reply shows this. Second part—SCSS— uses those groupings along with flexbox to style the form).

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1144 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 63 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 138 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 114 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 132 7 months ago