orbeon

Orbeon Forms: Change Style in and Action


Sorry again for the simple question..

How can I change the background colour of a text box or an explanatory text box in a action?

Many thanks in advance.

PeteA


Solution

    1. In your own CSS (doc), write a rule so that if your text box or explanatory text where to have a given CSS class of your choice on it, say highlight, then it would get the required background color.
    2. In the control settings for that text box or explanatory text, under custom CSS classes, use an XPath value template to produce the highlight class only when a certain condition is met, say {'highlight'[//total > 100]}, which would add the class highlight if the value of the field total is above 100.
    3. If you can't directly determine whether the class should be added or not based on other values in the form, and you really needs to run an action, then have that action set the value of hidden field that you use in your XPath value template in step two.