需要用户ID号的表单提交

时间:2018-01-24 作者:AJChambers

我是个新来这里问问题的人,所以如果有任何帮助,我将不胜感激。

我正在为一个即将举行董事会成员选举的组织管理一个Wordpress网站,他们希望使用表单在线进行选举。他们目前使用忍者形态。

为了验证每个表单提交,他们想看看是否只有在用户输入将分配给他们的序列号,或者Wordpress自动分配给用户的ID之后,才可能接受表单。

有没有想过要做到这一点?或者是追踪开发人员以帮助完成此任务的最佳地点。

提前谢谢你。

AJ公司

1 个回复
最合适的回答,由SO网友:WebElaine 整理而成

If you don\'t want to touch code, you could create a page whose content only logged-in users can see. That way only valid users can see the form. You\'d want to look for a content restriction / membership plugin to handle the protection of that page. You can set a field - perhaps their email address - to only accept unique submissions, so if someone tried to vote twice, Ninja Forms would prevent them from even submitting a duplicate.

If you want to touch code, you could register a hidden field in your form (see https://paulund.co.uk/register-hidden-fields-ninja-forms but instead of including user IP you\'d use get_current_user_id() to capture their auto-generated WP ID). You would then also want to create a child theme and apply a template to that specific page to hide the form if the current user is not logged in.

结束

相关推荐

GravityForms to Salesforce API,离开公司的人的问题

我在WordPress网站上使用GravityForms,并有GravityForms to Salesforce API插件,该插件将填写表单的人员添加为Salesforce中的潜在客户。它工作得很好,除非人们没有输入公司名称。如果他们不进入公司,有没有办法将其默认为全名?这是我的密码。我添加了警报框来帮助调试,但它们甚至不运行!add_filter(\'gform_after_submission_1\', \'create_company_full_name\', 10, 4); func