在JavaScript中获取PHP的Checkbox []值 [英] Get Checkbox[] values in JavaScript for PHP

查看:63
本文介绍了在JavaScript中获取PHP的Checkbox []值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在检查复选框中的值时遇到问题。我试图清理代码。


我可以选中所有选中的复选框(但不是每行)或者我可以获得每行的复选框ID但是不是选定的值。我很确定我可以将值传输到另一个页面,但不知道如何获取它们。


这里的任何帮助都将非常感激!

展开 | 选择 | Wrap | 行号

解决方案

复选框不会发出更改事件,因为它们的值永远不会改变(只有通过JS,也许)。


我正在使用该类在Javascipt中启动更改事件。它工作但我无法弄清楚如何获取每个表行选择的值

我已经创建了一个小提琴页面,如果有人可以提供帮助,那么它就会出现问题。它是一个包含2行复选框的HTML表。我需要获取每行的已检查数据,而我能弄清楚的是如何获取所有选中的值...如果有人可以提供帮助,这里是链接: http://jsfiddle.net/RevPhil/yqh3x/


I am having an issue getting the values checked in the check-box. I have tried to clean up the code.

I can get the all the selected check-boxes selected (but not per row) or i can get the check-box id per row but not the selected value. I am pretty sure I can transfer the values to the another page but do not know how to get them.

Any assistance here would greatly be appreciated!

Expand|Select|Wrap|Line Numbers

解决方案

checkboxes do not emit a change event, because their value never changes (only through JS, maybe).


i am using the class to initiate the change event in Javascipt. It works but i can not figure out how to get the values selected per table row


I have created a Fiddle page that has the problem in it if anyone can assist. Its an HTML table with 2 rows of checkboxes. I need to get the checked data per row, and all I can figure out is how to get all checked values... Here is the link if someone can assist: http://jsfiddle.net/RevPhil/yqh3x/


这篇关于在JavaScript中获取PHP的Checkbox []值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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