Jquery Tracking 复选框从选中更改为未选中或已取消选中
假设我有四个复选框,形式为 Check-a、Check-b、Check-c、Check-d。
Check-a 和 Check-b 已被选中。我可以使用 Jquery 获取哪个复选框被选中或未被选中。
现在我已经取消选中Check-a。所以 Check-a 已被选中,而我已将其从选中状态取消选中。所以现在 Check-c 和 Check-d 已经被我取消选中,而 Check-a 也被我取消选中。我正在寻找一种方法来跟踪哪些是未选中的,哪些是以前未选中的。
谁能告诉我一个方法吗?
Suppose I have four check-boxes in a form Check-a,Check-b,Check-c,Check-d.
Check-a and Check-b are already selected.I can get which check-box is checked or not unchecked by using Jquery.
Now I have unchecked Check-a. So Check-a were checked and I had made this unchecked from checked. So now Check-c and Check-d were already unchecked and Check-a is unchecked by me.I am in search of a way to track which are unchecked from checked and which were previously unchecked.
Can Anyone Tell me a way ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设与 @definitelyundefinable 相同的 HTML,这做了同样的事情,但它稍微干净一些,因为它不使用隐藏字段和假数组(作为隐藏字段中的字符串)
Assuming the same HTML as @definitelyundefinable, this does kind of the same thing but it's slightly cleaner because it doesn't use hidden fields, and fake arrays (as strings in the hidden field)
如果您需要一种点击历史记录,为什么不使用额外的字段呢?
html:
jquery 脚本:
您可以将其隐藏并评估 ;之后分开列表..
if you need a kind of click-history, why not just use an extra field?
html:
jquery script:
you can make it hidden and evaluate the ; separated list afterwards..