我正在使用联系表格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"]
提前谢谢!
答案 0 :(得分:1)
似乎正在发送表单,因为选择域确实总是被填写。您忘记了“ include_blank”属性:
[select* menu-834 include_blank "product 1" "product 2" "product 3"]
它将空白项目插入到下拉菜单的选项顶部,该菜单的评估结果为未填写。
https://contactform7.com/checkboxes-radio-buttons-and-menus/