Skip to content

Instantly share code, notes, and snippets.

@emamut
Created March 26, 2014 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emamut/9786592 to your computer and use it in GitHub Desktop.
Save emamut/9786592 to your computer and use it in GitHub Desktop.
Getting all selected checkboxes in an array
$('#process').on('click', function(){
var checkboxs_checked = [];
$("input:checkbox:checked").each(function() {
checkboxs_checked.push($(this).val());
});
console.log(checkboxs_checked);
if(checkboxs_checked.length == 0)
alert('Seleccione al menos una hora extra para procesar!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment