【发布时间】:2019-01-23 13:54:48
【问题描述】:
我正在使用 Contact Form 7 为客户制作表格。我已将所有字段设为必填,包括选择(下拉)字段。但是,当未选择下拉字段时,仍会发送表单。
有没有办法“强制”一个字段是必需的?有没有人遇到过这个?你知道如何提供帮助吗?
这是我的代码:
<label> Name: (Required)
[text* your-name] </label>
<label> Surname: (Required)
[text* your-name] </label>
<label> Contact Number: (Required)
[text* your-number] </label>
<label> Email Address: (Required)
[email* your-email] </label>
<label> Choose Branch: (Required)[select* recipient "Choose Branch:"
"Johannesburg|christie@oonie.co.za"
"Pretoria|christie@oonie.co.za"
"Cape Town|christie@oonie.co.za"
"Durban|christie@oonie.co.za"
"Garden Route|christie@oonie.co.za"
"Port Elizabeth|christie@oonie.co.za"
"East London|christie@oonie.co.za"
"Nelspruit|mchristie@oonie.co.za"
"Vaal Triange|christie@oonie.co.za"]</label>
<label> Product: (Required)[select* product "Please select product:"
"Product"
"Product"
"Product"
"Product"
"Product"
"Product"
"Product"
"Product"]</label>
<label> Physical Address: (Required)
[text* your-area] </label>
<label> Size in Meters: (Required)
[text* your-area] </label>
<label> Enquiry
[textarea your-message class:bigger-textrea] </label>
[submit "Send"]
提前谢谢你!
【问题讨论】:
-
要求对其他领域有效吗?如果您将必填文本字段留空,是否也会发送表单?
-
嗨@jasie。所有其他必填字段均有效。只有在选择或未选择产品时才会发送它。感谢您的评论!
-
对于表单验证器,我认为“请选择产品:”和“选择分支:”验证为填写。