简体   繁体   English

Drupal WebForm条件

[英]Drupal WebForm Conditionals

I need to build a webform where one of the questions asks the user to pick a date from a list of 5 dates. 我需要构建一个网络表单,其中一个问题要求用户从5个日期的列表中选择一个日期。 Each of the 5 dates only allows 10 attendees. 5个日期中的每个日期仅允许10位参与者。 How can I track the number of people that have registered for each date and limit the number of attendees? 如何跟踪每个日期的注册人数并限制参加人数? Thanks for any help. 谢谢你的帮助。

Go for some custom solution. 寻找一些自定义解决方案。 Ie create some content type with 5 integer fields where you will keep count of attendees per day. 即创建具有5个整数字段的某些内容类型,您将在其中每天保留与会者人数。

Then hook that webform (hook_form_alter()) and add another submission handler function, like described here: 然后,钩住该webform(hook_form_alter())并添加另一个提交处理程序函数,如下所示:

Drupal 7 Webform submit hook Drupal 7 Webform提交钩子

In that function (submit handler) read the form values increase counter if it has free space or shoot some message that no more places remained. 在该函数(提交处理程序)中,如果窗体具有可用空间,则读取表单值增加计数器,或者发出一些消息,指出不再剩余任何地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM