修改Webform模块
我需要一些帮助来修改 Webform 模块,以便它可以适用于我的项目。 我现在使用 Webform 来处理单页、基本表单,效果非常好。 我需要能够获取多个网络表单并根据用户所做的一些初始选择将它们串在一起。 让我举个例子。
用户被发送到“一般信息”网络表单,他们在其中输入姓名和生日等信息。还有 3 个带有复选框的问题,分别是:
“您有房子吗”
“您有汽车吗”
“您有孩子吗”
用户可以选择全部、部分或不选择任何选项。根据用户的选择,一旦他们按下提交按钮,他们将被发送到“房屋表格”、“汽车表格”和/或“儿童表格”。
当他们填写完所有表格后,系统会向管理员发送一封电子邮件,就像现在的网络表单一样。该信息不需要存储在网站的数据库中,电子邮件就足够了。
那么,关于如何做到这一点有什么建议吗?除了 Webform 之外还有其他更合适的吗?或者(如果我超级幸运)是否已经存在一个可以满足我需要的模块?
I need some help modifying the Webform Module so that it can work for my project.
I use Webform right now for single page, basic forms, and it works wonderfully.
What I need to be able to take multiple webforms and string them together based on some initial selections a user makes.
Let me give an example.
The user is sent to a "General Information" webform, where they put in things like name and birthday. There are also 3 questions with check-boxes which are:
"Do you have a house"
"Do you have a car"
"Do you have children"
The user can select all, some, or none of the options. Based on what the user selects, once they press the submit button, they will be sent to the "House form", "Car form", and/or "Children form".
When they're done filling out all the forms, an email is sent to the admin just like webforms does now. The information does not need to be stored on the website in the database, the email is sufficient.
So, any suggestions on how to do this? Would something else besides Webform be more appropriate? Or (if I'm super lucky) does a module which does what I need already exist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么不简单地根据需要显示或隐藏表单元素,而不是重定向到其他可能多个后续表单?
使用以下 (x)html:
和 jQuery(可以整理,但我自己还是新手......所以恐怕只是“概念证明”):
现场演示当前位于:< a href="http://davidrhysthomas.co.uk/so/subForms.html" rel="nofollow noreferrer" title="链接到演示。">http://davidrhysthomas.co.uk/so/subForms.html
Why not simply show, or hide, the form elements as required, rather than redirect to other, potentially-multiple subsequent, forms?
Using the following (x)html:
And the jQuery (which could be tidied, but I'm still new at it myself...so 'proof of concept' only, I'm afraid):
Live demo currently located at: http://davidrhysthomas.co.uk/so/subForms.html
条件字段是即将推出的 Webform 版本 3 的一项功能。请参阅相关的 问题 和 测试版于两周前发布。
Conditional fields are a feature of the upcoming Webform version 3. See the related issue and the beta version that was released two weeks ago.
创建自定义模块,它将捕获通过 hook_nodeapi 的提交并重定向到正确的表单或页面...
Create custom module, that will catch submit via hook_nodeapi and redirect to proper form or page...