隐藏的复选框值不包括在jQuery .serialize() [英] Hidden checkbox values are not included in jQuery .serialize()

查看:333
本文介绍了隐藏的复选框值不包括在jQuery .serialize()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jQuery插件DataTables,它帮助我显示大量分页的数据表,包括许多行与复选框。所有的工作原理预期在Chrome,但在IE8当我序列化的DataTable表单包含复选框,只有可视的复选框被序列化。在数据表中,分页允许您选择复选框,并移动到不同的结果页面(比如说11-19,而不是1-9),但保持之前在不同结果页面上所做的选择。

I am using the jQuery plugin "DataTables" which helps me display large paginated tables of data including many rows with checkboxes. All works as expected in Chrome, but in IE8 when I serialize the DataTable form containing checkboxes, only the checkboxes that are visiable are serialized. In Datatables, the paginations allows you to select checkboxes and move to a different page of results (say 11-19 instead of 1-9) yet maintain the selection previously made on a different page of results.

当我在$ .post调用中使用$(#theForm)。serialize()时,只包括可见的复选框。在Chrome中,使用.serialize()找到包含隐藏复选框的所有复选框的整个列表不是这种情况。

When I use $("#theForm").serialize() in a $.post call, only the visible checkboxes are included. This is not the case in Chrome where the entire list of selected checkboxes including hidden checkboxes are found with .serialize().

这种情况似乎以前必须发生其他人,让我知道如果有解决方案!谢谢!

This situation seems like it must have happened before to other people, let me know if there is a solution! Thanks!

推荐答案

解决方法是取消隐藏复选框序列化,并重新隐藏它们。这不会导致一堆复选框出现和消失,因为它发生这么快。

The solution was to unhide the checkboxes serialize, and re-hide them. This does not result in a bunch of checkboxes appearing and disappearing because it happens so fast.

这篇关于隐藏的复选框值不包括在jQuery .serialize()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆