# Grouping Consecutive Pages into Repeatable Sections

Repeatable forms are not always limited to a single page.

Some customer entries require multiple pages of information. For example, a registration form might collect basic details on one page and preferences on another.

When these pages belong to the same repeated entry, they need to be treated as a group.

Cruxtab Contact Form Builder supports grouping a page, or a run of consecutive pages, with the same label into a repeatable section.

## Why page grouping matters

Consider a form that collects information for multiple attendees.

Each attendee needs:

**Page 1: Attendee Details**

- Name
- Email address

**Page 2: Attendee Preferences**

- Meal choice
- Special requirements

If only the first page were repeated, the form could collect multiple names but would not associate the preference information correctly with each attendee.

Grouping the consecutive pages allows the repeated entry to contain the complete structure.

## The shared label

The feature uses a run of consecutive pages with the same label to identify the repeatable group.

Conceptually:

```text
Attendee Details
        |
Attendee Preferences
        |
        v
      Group A

Attendee Details
        |
Attendee Preferences
        |
        v
      Group B
```

Each repeated group represents one attendee.

The pages within a group are completed together as part of that repeated entry.

## Why consecutive pages matter

The grouping behavior is based on consecutive pages.

This means the sequence of pages is important.

For example:

```text
Attendee Details
Attendee Preferences
Additional Information
```

If the relevant pages share the same label, they can form the repeated group according to the grouping rules.

However, inserting an unrelated page between repeated pages can affect how the group is identified.

Developers and merchants should understand this behavior when designing the form's page structure.

## Repeatable groups versus individual fields

A repeatable section is more than a collection of duplicated fields.

It creates a logical structure around the repeated data.

For example, instead of receiving independent values such as:

```text
attendee_1_name
attendee_1_email
attendee_2_name
attendee_2_email
```

The form can represent repeated entries as a group of structured records.

This makes the data easier to associate and process.

## Implementation considerations

The grouping behavior needs to remain consistent between:

- Liquid rendering
- Storefront JavaScript
- Server-side submission validation

The feature specification identifies that grouping logic exists in all three layers, but their slug rules differ slightly.

This is an important implementation detail because inconsistent grouping can lead to the storefront and server interpreting the same page structure differently.

## Test page-grouping behavior

A useful test plan includes:

- A single repeatable page.
- Two consecutive pages with the same label.
- Three consecutive pages with the same label.
- An unrelated page between repeated pages.
- Pages with similar but not identical labels.
- Multiple repeatable groups in the same form.

These scenarios can help identify unexpected grouping behavior.

## Conclusion

Grouping consecutive pages allows repeatable sections to contain more complex structures than a single page.

Cruxtab Contact Form Builder supports a page or run of consecutive pages with the same label being filled multiple times.

Because grouping logic exists in Liquid, JavaScript, and the server, consistency between those layers is especially important.

Explore [Cruxtab Contact Form Builder](https://apps.shopify.com/cruxtab-form-builder).
