使用重力形式计算复选框 [英] Count Checkboxes with Gravity Forms
问题描述
我正在制作一个用于用户注册的夏令营注册表.在表格的最后,您可以选择全额支付或为每个选定的营地支付 50 美元的押金.我使用隐藏产品来处理每周的总金额并将它们的价值添加到总数中.我的问题是我是否可以使用公式来计算已选中复选框的数量并进行计算.
示例:
第 1 周:
- 足球训练营
第 2 周:
- 计算机营
总计:100 美元(押金)
我实际上有一个片段:
https://gist.github.com/spivurno/077fd21a993e9b573d46罢工>
更新:https://gist.github.com/spivurno/a14ef4a18f581d07a178f587d81781b78181781b> 参数为: I'm making a form that is for a summer camp registration form where users will be registering. By the end of the form there is an option of paying in full or making a $50 deposit for each camp selected. I'm using hidden products to handle the total amount per week and adding their value into the total. My question comes if I can use formulas to count the number of checkboxes that have been selected and do the calculations. Example: Week 1: Week 2: Total: $100 (Deposit) I actually have a snippet for this: Updated: https://gist.github.com/spivurno/a14ef4a18f57d0c67811e1b4d8791781 The parameters are: 这篇关于使用重力形式计算复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!form_id
要计算其复选框数的表单的 IDcount_field_id
要填充复选框计数的字段的 ID(然后您可以在计算公式中使用此字段的合并标记)checkbox_field_ids
一组复选框字段 ID,其复选框应计入复选框计数(选中时)
https://gist.github.com/spivurno/077fd21a993e9b573d46
form_id
the ID of the form for which you would like to count the checkboxescount_field_id
the ID of the field into which you would like to populate the checkbox count (you can then use this field's merge tag in a Calculation formula)checkbox_field_ids
an array of Checkbox field IDs whose checkboxes should count towards the checkbox count (when checked)