我有一个这样的复选框
<input name="notify" type="checkbox" id="notify" class="notify" />
我正在使用这样的ajax调用
$("form#submit").submit(function() {
// we want to store the values from the form input box, then send via ajax below
var username = $('#username').attr('value');
var email = $('#email').attr('value');
var password = $('#password').attr('value');
var cpassword = $('#cpassword').attr('value');
var notify = $('#notify').attr('value');
var session_user_id = $('#session_user_id').attr('value');
$.ajax({
type: "POST",
url: "../../includes/editprofile.php?",
data: "username="+ username+
"&email="+ email+
"&password="+ password+
"&cpassword="+ cpassword+
"¬ify="+ notify+
"&session_user_id="+ session_user_id,
success: function(data){
$('div.success').fadeIn();
$('div.success').html(data);
}
});
return false;
});
在我的 editprofile.php 文件中,我只是 echo'n $notify 以查看提交表单后的值是什么,无论我是否选中该框,它总是“打开”。有什么线索吗?