Skip to content

Instantly share code, notes, and snippets.

@bruno2ms
Created June 4, 2013 17:04
Show Gist options
  • Save bruno2ms/5707677 to your computer and use it in GitHub Desktop.
Save bruno2ms/5707677 to your computer and use it in GitHub Desktop.
Bits of jQuery
// Selects every input DOM element in a form and filter the selection to mantain
// only the ones that value isn't falsey.
// i.e.: Empty Textareas, empty Inputs , not checked radios and Checkboxes
// Issue: it consider the 0 value or "0" as false
$("form :input").filter(function(){
return $(this).val() != false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment