How do I change the text color of an InfoPath text box?

I have a textbox in a repeating table. I can check what's inside, but if the text doesn't pass my check, it should change color to red.

Does anyone know how I can achieve this goal with code?

I found a solution for a rich textbox by setting innerXml to the following:

"This is just a piece of <span xmlns="http://www.w3.org/1999/xhtml" style="color:red">red text</span>."

      

Unfortunately this doesn't work. A namespace error occured: / But even if that works, I don't want to have a richt textbox, as a textbox in an InfoPath form shouldn't have a "menu" above the field.

0


source to share


1 answer


Maybe compomise:

Set up the bool field in your main data source (FieldXYValid). Create a rule to set the text color in a field to red if FieldXYValid is false.



Set FieldXYValid in C # code after validation.

+1


source







All Articles