我使用jquery
提交了一个表单使用以下格式(HTML表格)
$(document).ready(function () {
$("#form_submit").click(function() {
$("#RegisterUserForm").trigger('submit');
});
$("#RegisterUserForm").validate({
onkeyup: false,
submitHandler: contact_submit
});
$('#verificationcode').attr('value', '');
function contact_done() {
window.location = '/';
}
function contact_submit() {
$.ajax({
type: "POST",
url: "thankyou.php",
data: $("#contact_form").serialize(),
success: function(data){
if (data == "SUCCESS")
alert('sucess');
else if (data == "BADCODE")
alert("The security code you typed was wrong. Please try again.");
else
//alert("Message not sent, please try again. Error data: "+data);
}
});
}
});
php代码是:
sendmail(params)
{
echo "SUCCESS";
}
else
{
echo "BADCODE";
}
在iframe中我提交表单但是在页面中打印值Success或badcode而不返回jquery表单