< Day Day Up > |
One of the novel features of InfoPath form templates (at least, if your previous experience has been limited to HTML forms) is the capability of InfoPath forms to change their appearance in response to form events, or according to the values contained in fields in the data source. This visual adaptability in InfoPath is called conditional formatting . Conditional formatting allows form designers to highlight certain parts of a view in response to choices made by a user , or to hide or reveal parts of a form in response to choices made by users when filling in a form. Conditional formatting is available on the following form controls:
Conditional formatting is not available on the following form controls:
You can position the form controls for which conditional formatting is not available inside form controls that do support conditional formatting, and thereby apply conditional formatting to them. Specifying Conditional FormattingIf conditional formatting is available, it is always accessed in the same way: Right-click on the form control and select the formControlName Properties option at the bottom of the context menu. A Properties window opens. Select the Display tab, and click the Conditional Formatting button. This opens the Conditional Formatting window (see Figure 6.19). Figure 6.19. The Conditional Formatting window.
If no conditional formatting has been applied to the form control, no conditions are listed. To apply a condition, click the Add button on the Conditional Formatting window. The Conditional Format window opens (see Figure 6.20). Figure 6.20. The Conditional Format window.
Specifying conditions depends on named fields. We will use the SimpleHR3.xsn form template from Chapter 4. Follow these steps:
Thus, if you want to specify some conditional formatting if the value of the LastName field is Watt , you can make the choices shown in Figure 6.24 to create a conditional formatting rule. Figure 6.24. A conditional formatting rule.
If you want to create only one conditional formatting rule, you can move on to specify what format is desired. If a second or subsequent rule is desired, click the Add button to the right of the three drop-down menus . Types of Conditional FormattingSeveral types of conditional formatting are available in InfoPath 2003. You can hide the form control completely by checking the Hide This Control check box. If you do so, the other options are grayed out. Assuming the form control is to remain visible, you can change the background color (shading) of the form control and its font characteristics by making one or more selections from the Bold, Underline, Italic, and Strikethrough check boxes and the Font Color and Background Color drop-down menus. |
< Day Day Up > |