Insert an optional section
You can create an optional section on your form that users can choose to insert and remove when they fill out the form. By default, an optional section does not appear on the form until a user inserts it. For example, on a travel request form, you can include an optional "Car Rental" section. Users who need to rent a car can insert and fill out this optional section; those who don't need to rent a car can leave the section hidden.
Optional sections are bound to groups. Any control in an optional section must be bound to a field that is part of the optional section's group. Unlike conditional formatting, which can make a section invisible but does not remove it from the data source, an optional section is not part of the form's data source until a user inserts it.
Insert an optional section (automatically create the data source)
You can have Microsoft Office InfoPath 2003 automatically create the data source when you insert optional sections (as well as other controls). If you do this, InfoPath creates a group in the data source that is bound to the optional section.
- In design mode, place the insertion point where you want to insert the optional section.
- If the Controls task pane is not visible, click More Controls on the Insert menu.
- In the Controls task pane, select the Automatically create data source check box.
Note If the check box is unavailable, the form's design does not allow the data source to be automatically created. You must insert an optional section that is bound to an existing group or to a group that you create.
- Under Insert controls, click Optional Section.
- To add controls to the optional section, drag the controls that you want from the Controls task pane into the optional section.
Note You should not move a control that is already on the form into the optional section, unless the control's field is already part of the optional section's group.
- To customize the optional section, right-click the
Optional Section
label that appears below the section, and then click Section Properties. In the Section Properties dialog box, do either of the following:
Customize the hint text that users click to insert the optional section
- On the Data tab, select the Show insert button and hint text check box.
- In the box below the check box, type the text that you want users to see.
Show the optional section on the form by default
- On the Data tab, click Include the section in the form by default.
- Select the Allow users to delete the section check box.
Insert an optional section (bind to an existing group)
- In design mode, place the insertion point where you want to insert the optional section.
- If the Data Source task pane is not visible, click Data Source on the View menu.
- In the Data Source task pane, right-click the group that you want to bind the optional section to, and then do one of the following:
- To insert an optional section that contains controls, click Optional Section with Controls on the shortcut menu. The controls will be bound to the fields in the section's group.
- To insert an optional section that does not contain controls, click Optional Section on the shortcut menu.
Note If you do not see either choice on the shortcut menu, make sure that the group does not repeat.
- To customize the optional section, right-click the
Optional Section
label that appears below the section, and then click Section Properties. In the Section Properties dialog box, do either of the following:
Customize the hint text that users click to insert the optional section
- On the Data tab, select the Show insert button and hint text check box.
- In the box below the check box, type the text that you want users to see.
Show the optional section on the form by default
- On the Data tab, click Include the section in the form by default.
- Select the Allow users to delete the section check box.
Notes
- If a user removes an optional section after filling it out, the data in that section is lost, not hidden.
- The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed. Learn more