Hide or disable a control based on values in a form

You can use conditional formatting (conditional formatting: The process of changing the appearance of a control, including its visibility and read-write state, based on values entered into the form.) to hide or disable a control based on the value of another control on the form. For example, a text box for a driver's license number can be read-only unless the user enters an appropriate age into another control on the form.

  1. In design mode, select the control you want to hide or disable, and then click Conditional Formatting on the Format menu.
  2. In the Conditional Formatting dialog box, click Add.
  3. In the first box under If this condition is true, click Select a field or group.
  4. In the Select a Field or Group dialog box, select the field whose value will determine whether the control is hidden or disabled, and then click OK.

 Note   Microsoft Office InfoPath 2003 verifies a condition by checking the value of the field (field: An element or attribute in the data source that can contain data. If the field is an element, it can contain attribute fields. Fields store the data that is entered into controls.) that is bound (bind: To connect a control to a field or group in the data source so that data entered into the control is saved. When a control is unbound, it is not connected to a field or group, and so data entered into the control will not be saved.) to the control, not the control itself.

  1. In the second and third boxes under If this condition is true, enter the rest of the condition, and then do one of the following:
    • To disable the control, select the Read-only check box. Depending on the type of control, this check box may be labeled Don't allow users to insert or delete this control or Disable this control.

 Note   To disable the controls in a section, you must disable each control in the section. Disabling the actual section only prevents users from inserting or deleting the section.

  • To hide the control, select the Hide this control check box.

 Note   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.

 
 
Applies to:
InfoPath 2003