1 回答
TA贡献1839条经验 获得超15个赞
您没有在 AJAX 调用中发送所选单选按钮的值。用$(":radio[name=rGroup]:checked").val()得到这个。
function submitForm() {
// Initiate Variables With Form Content
var name = $("#name").val();
var email = $("#email").val();
var phone = $("#phone").val();
var date = $("#date").val();
var time = $("#time").val();
var msg_subject = $("#msg_subject").val();
var message = $("#message").val();
var rgroup = $(":radio[name=rgroup]:checked").val();
$.ajax({
method: "POST",
url: ajcf.ajaxurl,
data: {
action: 'ajcf_sentemail',
name: name,
email: email,
phone: phone,
date: date,
time: time,
msg_subject: msg_subject,
message: message,
rGroup: rgroup
},
success: function(text) {
if (text == "success") {
formSuccess();
} else {
formError();
submitMSG(false, text);
}
}
});
}
- 1 回答
- 0 关注
- 104 浏览
添加回答
举报