You can use serialize to serialize form elements in a line for logging. It follows the same rules for the inclusion or absence of elements as a representation of the regular form. The only caveat is that the contents of input type="file" fields are not serialized for obvious reasons.
To start it when changing any of the inputs:
$("form :input").change(function() { console.log($(this).closest('form').serialize()); });
demo using the form shown in the documentation
source share