Created
March 5, 2012 11:02
-
-
Save infyloop/1977883 to your computer and use it in GitHub Desktop.
my collection of js often re-used snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// will get the id of the elements in the checkbox iff they are selected. | |
the html should be: | |
<input type="checkbox" name="check_box_17" value="17"> | |
<input type="checkbox" name="check_box_18" value="18"> | |
<input type="checkbox" name="check_box_19" value="19"> | |
$("#delete-clients").click(function() { | |
var arc = []; | |
$("input:checked").each(function(i, obj) { arc.push($(obj).val()) }); | |
if (arc.length > 0) { | |
$.post("/ajax/url/", {clients:arc}, function(data){ | |
window.location.reload(); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment