Created
June 20, 2019 12:42
-
-
Save jsvini/d51c72b13fb45e0704714af57d228265 to your computer and use it in GitHub Desktop.
console.table() all forms fields
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
$('form').each(function(){ | |
var formData = $(this).serializeArray(); | |
var compressed = {}; | |
formData.forEach(function(field){ | |
compressed[field.name] = (field.value)? field.value: '[empty]'; | |
}) | |
console.table(compressed); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment