Hide a control based on values in a form

Microsoft Office InfoPath

Show All Show All

Hide a control based on values in a form

You can use conditional formatting to hide 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 hidden unless the user enters an appropriate age into another control on the form.

Note  The following controls can have conditional formatting: text boxes, rich text boxes, sections, optional sections, repeating sections, repeating tables, and expression boxes.

  1. In design mode, select the control you want to hide, 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, and then click OK.

    Note  Microsoft Office InfoPath 2003 verifies a condition by checking the value of the field that is bound to the control, not the control itself.

  5. Enter the rest of the condition.
  6. Select the Hide this control check box.