开发者

Why does ajaxForm submit form in IE7/8 without AJAX?

开发者 https://www.devze.com 2023-03-30 07:05 出处:网络
I\'m pretty new to ajax, so I\'m surprised that this doesn\'t work or error for me in IE7/8. Works in other browsers though. This is a validation script that validates form content and then submits a

I'm pretty new to ajax, so I'm surprised that this doesn't work or error for me in IE7/8. Works in other browsers though. This is a validation script that validates form content and then submits a form. On success, it updates the page:

<script src="http://www.google.com/jsapi"></script> 
<script> 
    google.load("jquery", "1.6.2");
</script>
<script src="/javascripts/jquery.validate.js"></script>
<script src="/javascripts/jquery.form.js"></script>

[within a document ready function]

// prepare the form when the DOM is ready 
if ($("#contact_form").exists()){
    $("#contact_form").validate();

    // bind form using ajaxForm 
    $("#contact_form").ajaxF开发者_开发知识库orm({ 

        beforeSubmit:function() {
           return $("#contact_form").valid()
        },

        // target identifies the element(s) to update with the server response 
        target: "#success", 

        // success identifies the function to invoke when the server response 
        // has been received; here we apply a fade-in effect to the new content 
        success: function() { 
            $(".form-fields").hide();
            $("#success").fadeIn("slow"); 
        } 
    }); 
}

Thanks in advance! It does submit the form, but doesn't use ajax or do any error validation.


turns out it was this issue: jQuery Validation not working in IE7 + IE8

Had to revert back to jquery 1.5.2. who knew??

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号