Apply conditional formatting to a form template InfoPath 2007

Author: mety Labels::



What is conditional formatting?

In Microsoft Office InfoPath 2007, conditional formatting allows you to specify different formatting options for a control, based on conditions that occur on the form. If the specified conditions are true when a user fills out a form that is based on your form template, the conditional formatting is displayed. You can use conditional formatting to apply bold, underline, italic, strikethrough, font color, and background color to controls. You can also use conditional formatting to determine whether a control is visible on the form when users fill it out, whether the control is disabled, or whether to enable users to add or remove certain controls, such as optional sections (optional section: A control on a form that contains other controls and that usually does not appear by default. Users can insert and remove optional sections when filling out the form.).
The following includes some examples of how to use conditional formatting in a form template:
  • Hide the shipping address section unless the Specify Shipping Address check box is selected.
  • Change the font color to blue and the font style to bold for all expenses that require a receipt.
  • Change row colors in a repeating table based on the value of a text box in the row. For example, make the row for an item that is behind schedule red, and the row for an item that is on schedule green.
  • Mark financial entries with red text when they are less than $0 and green text when they are $0 or more.
  • Filter rows in a repeating table.
Note To display a message when a user enters incorrect values into a form, you can also use data validation (data validation: The process of testing the accuracy of data; a set of rules you can apply to a control to specify the type and range of data that users can enter.).

Compatibility considerations

When you design a form template in InfoPath, you can choose a specific compatibility mode to design a browser-compatible form template. When a browser-compatible form template is published to a server running InfoPath Forms Services, and then browser-enabled, forms based on the form template can be viewed in a Web browser. When you design a browser-compatible form template, some controls are unavailable in the Controls task pane because they cannot be displayed in a Web browser.
ShowList of controls that support conditional formatting
The following table lists the Office InfoPath 2007 controls that support conditional formatting, and whether they are available for browser-compatible form templates.
Controls that support conditional formattingAvailable for browser-compatible form templates?
ButtonYes
Check box Yes
Date picker Yes
Drop-down list box Yes
Expression box Yes
File attachment Yes
List box Yes
Option button Yes
Optional section Yes
Repeating section Yes
Repeating table Yes
Rich text box Yes
Section Yes
Text box Yes
Bulleted, numbered, or plain list No
Choice section No
Combo box No
Horizontal repeating table No
Ink picture No
Master/Detail No
Multiple-selection list box No
Picture No
Repeating recursive section No
Vertical label No


Add conditional formatting

  1. On the form template, select the control that you want to add conditional formatting to, and then click Conditional Formatting on the Format menu.
  2. In the Conditional Formatting dialog box, click Add.
  3. In the If this condition is true boxes, enter the condition. Note InfoPath 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.) to which the control 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.), not the control itself.
  4. To add additional conditions, click And, and then in the rightmost box under If this condition is true, do one of the following:
    • To apply the formatting only when both conditions are true, click and.
    • To apply the formatting when one or both of the conditions are true, click the arrow next to and, and then click or.
  5. Under Then apply this formatting, select the formatting that you want to apply for your condition or conditions, and then click OK. Note If more than one specified condition is true, InfoPath applies only the formatting of the first true condition.
  6. To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.

Change conditional formatting

  1. On the form template, select the control whose conditional formatting you want to change, and then click Conditional Formatting on the Format menu.
  2. In the Conditional Formatting dialog box, select the condition that you want to change, and then click Modify.
  3. In the If this condition is true boxes, modify the condition. Note InfoPath verifies a condition by checking the value of the field that is bound to the control, not the control itself.
  4. Select any new formatting that you want to apply for your condition or conditions, and then click OK.
  5. If you have multiple conditions for a control and want to change the order in which they are evaluated, select a condition in the Conditional Formatting dialog box, and then click Move Up or Move Down. Note If more than one specified condition is true, InfoPath applies only the formatting of the first true condition.
  6. To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.

0 comments |

Labels

Blog Archive

Powered by Blogger.

I made these pages for me and my friends to help solving the problem we face regarding Computer & internet, if anyone wants me to answer a question or find out about some information please send me email and I will try to reply.*P.S. some of the article I wrote and the other I found on the internet I posted them in sprit of learning and shearing, please forgive me if you found something you don’t want to be in my blog, email me and I will delete them. Thank you for your interest in my pages.امل نجم Amal Nagm

banner 1 banner 2