When using infopath, users who need to set different permissions can only perform operations on specific controls. They want to use infopath user roles, but infopath Forms Services does not support this function, in addition, infopath does not recommend this, so other methods are used for implementation. My method is very common and creative.
1. Add several controls to the form: text box txtname, button: btnok, text to be controlled: txtcontent, for example:
2. open the data source view and add an isvisible attribute to control the display of text. Enter isvisible in the name and select "select domain (attribute)" as the type. You can select "Domain (element )", however, I feel better when using attributes. The data type is boolean. The default value is false:
3. Right-click txtcontent and select the condition format:
Add a condition format for the control, such:
4. Then click the btnok eventCodeTo control the attribute values based on the required conditions:
5. You can preview the form.
Enter a random value:
Enter "Pipi ":
Click here to download the demo project