PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Group or create field groups.

  1. Is there a way to group fields into groups?

    Currently the form is outputs something like this...

    <form>
        <div>
            <ul id="gform_fields_2">
                <li id="gfield_2_1">...</li>
                <li id="gfield_2_2">...</li>
                <li id="gfield_2_3">...</li>
                <li id="gfield_2_4">...</li>
                <li id="gfield_2_5">...</li>
                <li id="gfield_2_6">...</li>
                <li id="gfield_2_7">...</li>
            </ul>
        </div>
    </form>

    For example I want to be able to group fields 2_3 to 2_6

    So the mark up would look like this...

    <form>
        <div>
            <ul id="gform_fields_2">
                <li id="gfield_2_1">...</li>
                <li id="gfield_2_2">...</li>
                <li id="gfield_group_1">
                    <ul>
                        <li id="gfield_2_3">...</li>
                        <li id="gfield_2_4">...</li>
                        <li id="gfield_2_5">...</li>
                        <li id="gfield_2_6">...</li>
                    </ul>
                </li>
                <li id="gfield_2_7">...</li>
            </ul>
        </div>
    </form>

    Basiccally I need to do some custom styling. I tried putting the html block in either side of 2_3 to 2_6 but the html block is also wrapped in a < li > block.
    So you cant exactly hack it using the html block to put this in the top html field block,

    <li id="gfield_group_1">
         <ul>

    and then this in a lower html field block...

    </ul>
    </li>

    ... as this breaks the page markup! Doh!

    Any ideas how I can group fields in a way like this?

    Thanks
    Josh

    Posted 11 years ago on Thursday December 6, 2012 | Permalink
  2. The trick is to close the previous < li > and < ul > then add your HTML, then open the < ul > < li > again. Please see this more verbose explanation by Kevin Flahaut.

    http://www.gravityhelp.com/forums/topic/fieldsets#post-17019

    Posted 11 years ago on Thursday December 6, 2012 | Permalink