I've tried different ways to get checkbox values, but none of them seemed to work. I need to extract them in order to execute a robot and tell it which lines it should take into consideration when running.
I'd appreciate if any of you could check my HTML (only the JavaScript code part) and give me some advise about what I'm doing wrong because it's simply not clicking.
https://jsfiddle.net/franrua/q7tr9623/26/
<script type="text/javascript">
function toggle(source) {
checkboxes = document.getElementsByName('checkbox');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
}};
$(document).ready(function() {
$("submit").click(function() {
var Lineas_Selec = [];
$.each($('input[type="checkbox"]:checked'), function() {
Lineas_Selec.push($(this).val());
});
alert("Lineas : "+Lineas_Selec.join(", "));
});
});
</script>
Aucun commentaire:
Enregistrer un commentaire