Introduction to controls

When creating a form, you can add controls, such as text boxes, lists, or check boxes, to either collect or display information to users. In addition to more simple, familiar controls, such as text boxes and option buttons, Microsoft InfoPath 2010 includes a number of more advanced controls, such as repeating tables, choice groups, and optional sections. These types of controls let you design a more complex form template providing greater flexibility in your form design. For example, in an expense report form template, a repeating table allows users to add a row for each expense item that they need to submit.

Information that users enter into a control is saved in the form. When designing a form template, insert controls from the Home tab, by using commands in the Controls group. Alternately, you can drag fields or groups from the Fields task pane onto the form template. A control based on the field type is inserted.

In this article

Controls and fields

Insert a control into a new, blank form template

Insert a control into a template based on a pre-existing field

Remove a control from a form template

Change a control on a form template

Types of controls

Input

Objects

Containers

Compatibility considerations

Controls and fields

In InfoPath, fields and controls are not the same thing. Fields are located in the Fields task pane and represent where the data that is being gathered is saved in the form. This data is stored as XML and can be used outside of InfoPath.

Together, the type of control and its associated field determine the type of information that users can enter into the control, as well as how users can enter that information. For example, if you have a date picker control on your form template that is bound to a field with a date data type, then users can enter only dates in that control. If a user tries to enter anything other than a valid date, such as their name or address, a data validation error appears on the control.

The following example shows a simple employee data form with three controls that are bound to three corresponding fields in the Fields task pane. The First Name control is bound to the firstName field, the Last Name control is bound to the lastName field, and the Employee ID control is bound to the employeeID field.

Introduction to controls

If a control is not bound to a field, such as if the field is deleted or if it is bound incorrectly, then the information that is entered into that control cannot be saved properly.

Multiple controls of any type can also be associated to one field. This is useful when you have one view to enter and modify data and another view that is read-only for display purposes. For example, a user can pick a value from a drop-down list box control and then that value appears in a read-only text box on another view. Since both controls are bound to the same field, they both show the same data that was picked by the user in the drop-down list box control.

Insert a control into a new, blank form template

To add a control to an InfoPath form template, click where you want the control to be added and then, from the Home tab, in the Controls group, click the control that you want to insert. When doing this, it is automatically associated — bound to — a new field in the form template data source as it is added. Fields are shown in the Fields task pane.

Introduction to controls

Note:  To add controls to your form without automatically creating a corresponding field, on the Home tab, in the Controls group, click the Dialog Box Launcher Controls Pane Dialog Box Launcher to open the Controls task pane, and then clear the Automatically create data source check box. You can bind the control to a field later.

Insert a control into a template based on a pre-existing field

If are working on a form template that was based on a pre-existing data source, such as a Web service or SharePoint list, or you have added a receive or submit data connection, then you can add a control based on one of the fields from this data source. To do this, drag that field from the Fields task pane to the form template. A control that is bound to the indicated field is added. You can also do this to add multiple controls that are bound to the same data source.

Note:  Using a receive or submit data connection allows you to create a connection to external data sources that can be used to submit data that users enter into a form or receive data from outside of the form, such as from a SharePoint list.

When you add a control to your form template this way, InfoPath inserts the type of control most frequently associated with the field data type. If this is not control type you want, it can be changed. Alternatively, click where you want to insert the control, right-click the field in the Fields task pane, and then select the type of control that you want to bind to the field.

Remove a control from a form template

To remove a control from a form template, select the control, and then press DELETE. When you remove a control, the field that is bound to that control remains in the data source. Data that is saved or retrieved in this field is not, however, shown to a user. To display any data that is bound to this field, you must bind it to another control. If, however, you do not want to use the field, you can delete the field by right-clicking it and then clicking Delete.

Change a control on a form template

Sometimes, you might need to change the type of a control, depending on the information that you are trying to collect. Likewise, InfoPath might automatically choose the wrong control type when adding a control that is based on an existing field. To fix this, change the control to another control type. Right-click the control, move the cursor over Change Control, and then click the desired control type.

Introduction to controls

Top of Page

Types of controls

The Controls task pane contains controls that you can add to your form template. These controls are grouped in the following categories:

The following tables describe the purpose of each control.

Input

Input controls include the controls that you typically associate with collecting and displaying information.

Control

Icon

Description

Text Box

Introduction to controls

The most commonly used control on a form. Users enter any type of unformatted text into a text box, such as sentences, names, numbers, dates, and times. Text boxes cannot contain formatted text.

Rich Text Box

Introduction to controls

Can contain formatted text, including bold and italic text, and a variety of fonts, font sizes, and font colors. In addition, users can insert images, lists, and tables into a rich text box.

Drop-Down List Box

Introduction to controls

Presents users with an expandable list of choices in a box. The choices can come from a list that you create manually, from values in the form data source, or from values that come from a data connection to an XML document, database, Web service, or SharePoint library or list.

Combo Box

Introduction to controls

Presents users with a list of choices in a box from which users select the appropriate item or type a new value. The choices can come from a list that you create manually, from values in the form data source, or from values that come from a data connection to an XML document, database, Web service, or SharePoint library or list.

Check Box

Introduction to controls

Allows users to set yes/no or true/false values by selecting or clearing a check box.

Option Button

Introduction to controls

Lets users select from a set of mutually exclusive choices. A group of option buttons is bound to one field in the data source, and each option button saves a different value in that field.

Date Picker

Introduction to controls

Contains a box where users can type dates and a button that displays a calendar which allows users to select a date.

Date and Time Picker

Introduction to controls

Allows the user to type the date and time or select a date from a calendar display.

Multiple-Selection List Box

Introduction to controls

Presents users with a list of choices that appear as a scrollable list of check boxes. Users can select as many check boxes as necessary, and may even be able to add custom entries, depending on how the form template is designed.

List Box

Introduction to controls

Presents users with a scrollable list of choices in a box from which users select the appropriate item. The choices can come from a list that you create manually, from values in the form data source, or from values that come from a data connection to an XML document, database, Web service, or SharePoint library or list.

Bulleted List

Introduction to controls

Allows users to add bulleted list items in the form. Bulleted list controls are a good way to include simple text that repeats, such as a list of action items in a meeting agenda form template.

Numbered List

Introduction to controls

Allows users to add numbered list items in a form. Numbered list controls are a good way to include simple text that repeats and indicates some sort of order, such as a list of agenda items in a meeting agenda form template.

Plain List

Introduction to controls

Allows users to add list items in a form. Plain list controls are a good way to include simple text that repeats, such as a list of attendee names in a meeting request form template.

Person/Group Picker

Introduction to controls

Allows users to type or select a user from a SharePoint list. Users can search through the directory for a user if they do not know the name of the person or group they want to enter.

External Item Picker

Introduction to controls

Allows users to type or select items from external systems through Business Connectivity Services.

Objects

Object controls include buttons, labels, and ways to insert attachments, pictures and hyperlinks when users fill out forms.

Control

Icon

Description

Button

Introduction to controls

Used to submit a form, switch views, or query a database. You can also associate a button with rules or custom code that runs when users click the button.

Picture Button

Introduction to controls

Similar to the Button control, you can select any picture to use as the button.

Calculated Value

Introduction to controls

Displays read-only text, displays the value of another control on the form, or creates formulas based on XPath expressions.

Vertical Label

Introduction to controls

A read-only text label that appears at a 90-degree angle on your form template.

File Attachment

Introduction to controls

Allows users to attach files to a form. Each file attachment control permits one file to be attached, and you can restrict the file type, if necessary. If your users want to attach multiple files, you can insert the file attachment control inside a repeating control.

Picture

Introduction to controls

Allows users to insert a picture as part of the form. Picture controls can save the image in the form itself or point the picture to a URL or Web address (such as http://contoso.com) of an existing picture.

Ink Picture

Introduction to controls

Users with a Tablet PC can create pictures using the stylus, either within the control itself or on top of a background picture.

Hyperlink

Introduction to controls

Used to enter a URL. For example, a form template that displays information about a list of products can include hyperlinks to product information Web pages. Hyperlink controls can point to any Web server on either an intranet or the Internet.

Signature Line

Introduction to controls

Allows users to digitally sign the form.

Containers

Container controls help organize form design by allowing other controls to be placed inside them. They also provide a way to allow multiple instances of a set of controls (repeating) or to allow the controls to be optional.

Control

Icon

Description

Section

Introduction to controls

Container for other controls. Sections can include any of the controls from the Controls gallery.

Optional Section

Introduction to controls

Container for other controls and is useful for including extra information that is not necessary for all users to fill out. When filling out a form that includes an optional section, users can choose whether to include the optional section or not.

Repeating Section

Introduction to controls

Container for other controls and is useful for presenting repeating data, such as employee database records. When filling out the form that includes a repeating section, users can add additional occurrences of the repeating section.

Repeating Table

Introduction to controls

Displays repeating information in a tabular structure. Each item appears in a new row in the repeating table. When filling out a form, users can add or delete rows in a repeating table as necessary. Repeating tables can contain other controls.

Scrolling Region

Introduction to controls

Contains other controls, retains a fixed size, and includes scroll bars so that users can scroll to see information that is out of view. Scrolling regions are particularly useful when a section of a form contains a lot of data, and users do not need to see it all at once.

Horizontal Region

Introduction to controls

Can be placed side-by-side on a form template which contains other controls.

Repeating Recursive Section

Introduction to controls

Contains other controls and can be inserted within itself. You can use repeating recursive sections to create hierarchical content, such as an outline.

Horizontal Repeating Table

Introduction to controls

Displays repeating information in a tabular structure. Each item appears in a new column in the repeating table. When filling out a form, users can add or delete columns in a repeating table as necessary. Horizontal repeating tables can contain other controls.

Master/Detail

Introduction to controls

A set of repeating controls that are directly related to one another. The master control is always a repeating table, and the detail control can be either a repeating table or a repeating section. Master/detail controls help organize large amounts of data. For example, if your form template displays employee database records, you can specify that only a subset of information about each employee should appear in the master control. Then, when a user selects a record (row) in the master control, the detail control can display more detailed information about the employee.

Choice Group

Introduction to controls

Allows the user to choose a section to include in the form. When filling out a form, users can replace the default section with a different section, as necessary. For example, on an employee information form template, the user can replace home address information with work address information.

Repeating Choice Group

Introduction to controls

Displays two or more choice sections in a repeating structure. When filling out a form, users can add, delete, or replace additional repeating choice groups, as necessary. For example, on an employee information form template, you can use a repeating choice group to let users enter multiple emergency contacts. For each contact, the user can replace home address information with work address information.

Choice Section

Introduction to controls

Inserts a section within a Choice Group. Each section can contain one or more controls. When filling out a form, users can replace the default section with a different section.

Top of Page

Compatibility considerations

Some controls work only in Filler forms, while others work in both Filler and Web browser forms. Additionally, some controls may work in an InfoPath 2010 Web browser form, but not work if you are working on an InfoPath 2007 Web browser form. In order to minimize the chances of using an incompatible control on a form, InfoPath naturally displays only the compatible controls to a user, based on the type of form that they are designing. To see the control compatibility information, refer to the Controls compatibility section of InfoPath 2010 features that are not available in InfoPath Forms Services.

Top of Page

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!

×