Created
June 4, 2013 17:04
-
-
Save bruno2ms/5707677 to your computer and use it in GitHub Desktop.
Bits of jQuery
This file contains 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
// 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