Prevent users from inserting or deleting a control
In Microsoft Office InfoPath, you can use conditional formatting to specify different formatting options for a control that is 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 applied.
This article explains how to use conditional formatting to prevent users who are filling out your form from inserting or deleting certain controls, such as optional sections, that are based on the value of another control. For example, if a user adds data to a rich text box that is inside an optional section and then removes the optional section, the data that the user entered is deleted. To help prevent this from happening, you can add conditional formatting to your form template to ensure that the optional section cannot be removed if it contains data.
Note: The ability for users to insert or delete repeating controls is automatically disabled for digitally signed data.
In this article
Before you begin
In order to complete this procedure, you must have one or more controls on your form template that support this type of conditional formatting. Refer to the following section for a list of controls that you can use in this type of procedure.
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.
List of controls that cannot be inserted or removed
The following table lists the Office InfoPath 2007 controls that can be set, by using conditional formatting, to ensure that a user cannot add or remove them. The table also lists whether the controls are available for browser-compatible form templates.
Control | Available for browser-compatible form templates? |
Horizontal repeating table | No |
Repeating recursive section | No |
Master/Detail | No |
Optional section | Yes |
Repeating section | Yes |
Repeating table | Yes |
Prevent users from inserting or deleting a control
-
On the form template, click the control that you want to prevent users from inserting or deleting.
-
On the Format menu, click Conditional Formatting.
-
In the Conditional Formatting dialog box, click Add.
-
Under If this condition is true, set the condition that you want. For example, to prevent users from deleting an optional section if it contains data, click the optional section in the first box, and then click is not blank in the second box.
-
Under Then apply this formatting, click Don't allow users to insert or delete this control.
-
To save the condition and return to the form template, click OK twice.
-
To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.
No comments:
Post a Comment