我正在提交正常的 aJaxSubmit 请求。它在 FireFox 和 Chrome 上完美运行。
但是,在 IE9 上它不起作用。它只进行到“beforeSubmit”并成功完成预回调提交,然后什么都不做。
IE9 开发者工具未显示 process.php 的帖子
这是我的代码:
$("#mainForm").validate({
rules: {
// This looks for the html artibute name="CaseSensitiveNameHere"
// Also the inital element being validated is case sensitive to whatever the html arrtibute is. So if it is name="EMAIL", then you must set the function below to EMAIL: { function } required: 'EMAIL'.
name: {
required: "name", // this means that the "name:" field must return the value == the "Name" function above - also it must have the same name as itself - so Name must have a function called Name
required: true // this makes "null" or emtpy invalid
},
email: {
required: 'email', //this means that the "Email:" field must return the value == the "Email" function above - also it must have the same name as itself - so Email must have a function called Email
required: true,
email: true // this makes "null" or emtpy invalid
},
webinarDate: {
required: true
},
webinar_date: {
required: true
},
webinar_time: {
required: true
}
}, // End Rules
messages: {
Name: "Enter Your First Name",
Email: "Enter A Valid Email",
webinarDate: "Choose A Webinar Time"
},
onfocusout: false,
//errorElement: "div",
errorPlacement: function(error, element) {
element.parent("td").prev("td").html(''); // Clears placeholder text in previous <td> element
//$(".errorBox").html(''); //Clears the text in #errorBox1 for error text to be placed there
error.appendTo( element.parent("td").prev("td") ) // places error text in previous sibling <td> element! woo yes! haha 2/4/11
//error.appendTo(".errorBox") // places error text in #errorBox1
.css('font-weight', 'bold'); // sets css for - error.appendTo so its error.appendTo.css
// other Error based scripts here!
},
success: function(label) {
label.addClass("valid").text("").removeClass("error");
},
submitHandler: function(form) {
jQuery(form).ajaxSubmit({
type: "post", // sets the method to POST (default is GET) if no "method" attribute is found on the <form> tag!!!
url: "process-autopilot.php",
crossDomain: true,
dataType: "json",
beforeSubmit: showRequest(), // run the BEFORE SUBMITTING CALLBACK aka Function - check if email is set to example@gmail.com, if true, return false, else, return true and go head and submit!
success: function(data, textStatus){ //do stuff
} });
有什么想法吗?谢谢!
最佳答案
兼容模式是打开还是关闭?
您是否尝试过通过以下方式设置 IE8 标准:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
关于json - jQuery AjaxSubmit 在 IE9 上未触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9526556/