jQuery的序列化和serializeArray工作不与谷歌浏览器不与、浏览器、序列化、工作

2023-09-10 21:22:15 作者:再2也得爱

我有以下的HTML。

<fieldset id="fieldset-step_3">   
       <input type="text" value="2" id="rule_form-lead_time" name="rule_form[lead_time]"> 
       <select class="w50" id="rule_form-operator" name="rule_form[operator]">
            <option label="&lt;" value="&lt;">&lt;</option>
            <option selected="selected" label="&gt;" value="&gt;">&gt;</option>
       </select>
       <button type="button" id="next" name="next">Next</button>
</fieldset>

我用下面的jQuery $ C $下获取值后,单击下一步按钮。

I use following jquery code for get values when click next button.

   $('#next').click(function () {
        var values = $('#fieldset-step_3').serialize();
        alert(values);          
   });

这code工作为Firefox 8和歌剧11.60测试版。但它并不适用于谷歌浏览器15.0.874.121工作。

This code working for firefox 8 and opera 11.60 beta. But it does not work for google chrome 15.0.874.121.

请帮助我。给我另外一个想法从jQuery的GET现场设置值。

Please help me. Give me another idea for get field-set values from jquery.

推荐答案

您似乎已经找到了一个错误。我在Chrome 11尝试这样做,看到了同样的事情。如果我序列化的形式,它的工作原理。如果我个人的序列化表单元素,它的工作原理。如果我尝试序列包含所有的表单元素,或字段集标签的DIV,它没有。

You seem to have found a bug. I tried this in Chrome 11 and saw the same thing. If I serialize the form, it works. If I serialize individual form elements, it works. If I try to serialize a div containing all of the form elements, or your fieldset tag, it doesn't.