【发布时间】:2014-12-12 21:58:17
【问题描述】:
我想从提交按钮上列出的选择复选框中获取多个复选框值。我试过node-event-delegate,但它不起作用:
AUI().use('node', 'event', 'node-event-delegate', function (A) {
var allcheckboxes = A.one('.plans').all(':checked');
console.info(allcheckboxes.size()); // It will give number selected checkboxes
A.all('.compare-products').each(function (node) {
console.info(node.currentTarget);
console.info(node, A.one(node(':checkbox:checked')));
if (A.one(node.currentTarget).all(':checked')) {}
});
A.all('.compare-products input[type="checkbox"]').filter(':not(:checked)').setAttribute("disabled", "disabled"); // it will disable the unchecked checkboxes
A.all('.compare-products input[type="checkbox"]').filter(':not(:checked)').removeAttribute("disabled", "disabled"); // it will remove disable attribute from unchecked checkboxes
});
【问题讨论】:
-
@Devang,“我想在提交按钮上列出的选择复选框中获取多个复选框值是什么意思。”那句话中的“on submit button”是什么意思?您还可以发布一些您尝试从中获取数据的复选框的示例
html吗? -
复选框定义值=""