IE 7上的ajaxSubmit问题

时间:2011-06-27 21:31:03

标签: jquery

我有以下内容:

$('#myForm').validate({
    groups:{ homeSize:"width length" },                
    rules: { bedrooms:  { required:true, number:true, range: [1, 5] },
             make: { required:true },
             bathrooms: { required:true, number:true, range: [1, 5] },
             year: { required:true, number:true, min:1950, max:2011 }
    },  
    messages: {
            bedrooms:  " Valid Number [1-5] Required!",
            make:      " Make is Required!",
            bathrooms: " Valid Number [1-5] Required!",
            year:      " Year is Required!"
    }, 
    errorElement: "em",

    errorPlacement: function(error, element) {
        error.appendTo(element.parent("td").find('span'));
        $('#divNewRBC').css('height','250px');      
    },  
    submitHandler: function(form){
        var options = { 
                beforeSubmit: function() {
                    $('#formSub').hide();
                    $('#formSave').show();

                },
                success: function(projectID) {
                    $('#formSub').show();
                    $('#formSave').hide();
                },
                url:'x.cfm'
        };  
        $('#myForm').ajaxSubmit(options);
    }
}); 

x.cfm只是通过电子邮件发送表单字段。在FireFox上,我得到表单字段。在IE 7上,表单字段为空。有帮助吗?

1 个答案:

答案 0 :(得分:1)

我在表格中有两个输入:

 <input type="text" name="width" id="width" value="W" class="inpAlt"/> x <input type="text" name="height" id="height" value="L" class="inpAlt"/><br/><span></span>

名称和ID导致了麻烦。当我将它们更改为hWidth,hHeight时,ajaxSubmit函数有效。