views:

675

answers:

3

I have a check box and a text field in my InfoPath form. When the check box is unchecked, I would like to clear the field content and then mark it as read-only.

I created a conditional formatting to mark the form as read-only and then a rule to clear the field content. However, I found that every time I enable both of them, the rule will not run.

To make sure, I created a pop-up dialog box in the rule too and I found every time I enable the conditional formatting to change the text field as read-only the dialog box will not show.

I am suspecting that by changing the text field to read-only suppresses the rule, which clears the text field content. Anyone knows how to fix this?

A: 

This is surely a bug with InfoPath, since i've had the same difficulty combining conditional formatting with rules (the conditional change never changes the formatting)

Janie
+1  A: 

Yeah this is weird...

If you go back and add a rule to the checkbox to update the value of the textbox when the checkbox value is "True". You will see that the rule on the textbox is now picked up.

I'm not sure why this is the case but I assume that its because the conditional formating stops all rules on the control and by adding a new rule to the checkbox it kick starts the rules on the control.

YetAnotherDeveloper
A: 

Put the rule onto the control whose value you are changing, so in this case, add the rule to the checkbox, not the field you wish to clear.

You can also add the conditional formatting to the textbox at the same time as this should not affect the outcome of the rule.

related questions