我在通过邮件发送多值复选框时遇到问题:
<input type="checkbox" name="wiztype[]" value="value1">
<input type="checkbox" name="wiztype[]" value="value2">
<input type="checkbox" name="wiztype[]" value="value3">
<input type="checkbox" name="wiztype[]" value="value4">
<input type="checkbox" name="wiztype[]" value="value5">
我正在尝试使用插件来验证表单,我在那里:
var wiztype = $("input[name='wiztype[]']:checked").serializeArray();
在mail-proces.php中,我有:
$wiztype = $_POST["wiztype"];
邮件中我有
[object Object],[object Object] (x number of selected boxes)
我试图做foreach
if(!empty($_POST['wiztype'])) {
foreach($_POST['wiztype'] as $wiztypelist) {
$wiztypelist;
}
}
我该怎么办?请帮忙:)