Orbeon Forms: 更改样式和操作

huangapple go评论96阅读模式
英文:

Orbeon Forms: Change Style in and Action

问题

抱歉,再次为这个简单的问题道歉。

如何在操作中更改文本框解释文本框的背景颜色?

非常感谢提前帮助。

PeteA

英文:

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

答案1

得分: 2

已解决:我在自定义CSS类字段中使用了以下语法:

{if (//PoWRA_Q1 = 'yes') then 'green' else 'red'}

非常感谢Alex指引我找对了方向。

PeteA

英文:

Solved: I used the following syntax in the Custom CSS Classes field:

{if (//PoWRA_Q1 = 'yes') then 'green' else 'red'}

Many thanks Alex for pointing me in the right direction

PeteA

答案2

得分: 1

  1. 在你自己的CSS中,编写一条规则,以便如果你的文本框或解释性文本具有你选择的CSS类(例如highlight),那么它将获得所需的背景颜色。

  2. 在该文本框或解释性文本的控件设置中,在自定义CSS类下使用XPath值模板,以便仅在满足某种条件时生成highlight类,例如{'highlight'[//total > 100]},如果字段total的值超过100,将添加highlight类。

  3. 如果无法直接根据表单中的其他值确定是否应添加该类,并且确实需要执行一个操作,那么该操作应设置隐藏字段的值,你将在第二步中在XPath值模板中使用。

英文:
  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.

huangapple
  • 本文由 发表于 2023年3月12日 17:45:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/75712279.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定