重力表单为基于响应的条件显示提供了一个快捷码。
[gravityforms action=“conditional”merge\\u tag=“{:3}”condition=“less\\u than”value=“30”]您的值小于30
有没有办法在这个短代码中使用两个条件?例如,我需要做大于10小于30的事情,比如:
[gravityforms action=“conditional”merge\\u tag=“{:3}”condition=“大于,小于”value=“10,30”]您的值大于10,小于30
上述方法不起作用,但想知道是否有人找到了这样做的方法?
最合适的回答,由SO网友:Dave from Gravity Wiz 整理而成
您可以嵌套短代码的单数和复数版本:
[gravityforms action="conditional" merge_tag="{:3}" condition="greater_than" value="10"]
[gravityform action="conditional" merge_tag="{:3}" condition="less_than" value="30"]Your value is greater than 10 less than 30[/gravityforms]
[/gravityforms]
更多详情请参见:
https://gravitywiz.com/gravity-forms-conditional-shortcode/
- 或-
您可以使用此代码段在单个短代码中创建多个条件:
https://gist.github.com/spivurno/9db18385ed1d1f11a897bdfa8a1f2007
[gravityforms action="conditional" relation="and"
value="{:3}" operator="greater_than" compare="10"
value2="{:3}" operator2="less_than" compare2="30"]
Your value is greater than 10 less than 30
[/gravityforms]