Grouping Fields

"It's still web development, it's just way easier!"

Group Fields for Loop Processes

A Single Group

Grouping fields provides an easy means of running processes on a set of fields the same way. A group needs to be defined by using an input field with the GROUP name and then each field that you want to be part of the group simply needs the group name and an underscore at the start of each field's name. When a form is posted each group becomes a comma separated list which can then be used in Loop Objects for processing.

GROUP is used for processing fields as if they were cookies, but are not actually written to a cookie. To access a group of fields use the GROUP's value as an object. The value will be a comma separated list of name and value pairs. In the following example, once the form has been submitted the object <#GROUP> will have a value of GRP and <#GRP> will have a value of name1=value1,name2=value2,name3=value3, not necessarily in that order, and assuming that all the checkboxes were checked.

<input type="hidden" name="GROUP" value="GRP">
<input type="checkbox" name="GRP_name1" value="value1" checked>
<input type="checkbox" name="GRP_name2" value="value2" checked>
<input type="checkbox" name="GRP_name3" value="value3" checked>

Submit, then...

<#GROUP> GRP
<#GRP> name1=value1,name2=value2,name3=value3

Multiple Groups

To make multiple groups within the same form simply put each group name within the value of GROUP separated by commes.

In the following example, once the form has been submitted, the object <#GROUP> will have a value of GrpX,GrpY,GrpZ, <#GrpX> will be A=A,B=B, <#GrpY> will be A=C,B=D, and <#GrpZ> will be A=E,B=F.

<input type="hidden" name="GROUP" value="GrpX,GrpY,GrpZ">
<input type="hidden" name="GrpX_1" value="A">
<input type="hidden" name="GrpX_2" value="B">
<input type="hidden" name="GrpY_1" value="C">
<input type="hidden" name="GrpY_2" value="D">
<input type="hidden" name="GrpZ_1" value="E">
<input type="hidden" name="GrpZ_2" value="F">

Submit, then...

<#GROUP> GrpX,GrpY,GrpZ
<#GrpX> 1=A,2=B
<#GrpY> 1=C,2=D
<#GrpZ> 1=E,2=F