Every now and then we may want to group a set of related fields together and present them with one label. This example aims to show you how to make a form that combines three number fields (separated by hyphens) for gathering a UK banking sort code.
This will gather the three parts of the sort code as separate fields and present it in a user friendly manner to the user.
As this recipe is a form to collect a UK bank account number and sort code we have written a custom
VType for the sort code. If you are not already familiar with how to write or use a
VType you'll find the two recipes in Chapter 5, Loading, Submitting, and Validating Forms, useful. The code for this VType is shown as follows: