In the earlier recipes, for example, the Retrieving fields when a lookup is populated recipe in Chapter 3, Capturing Data Using Forms, we have seen how to populate the contents of fields in response to user actions. This technique can also be used to change the characteristics of other input fields on the page in response to user selections.
In this recipe we will create a Visualforce page that allows a user to create five task sObject records at once. Each task is associated with a contact selected from a picklist. The picklist options are configured through a series of checkboxes; clearing a checkbox removes the contact from the picklist.
This recipe makes use of a custom controller, so this will need to be present before the Visualforce page can be created.