macek/jquery-serialize-object

how to filter the field that value is empty

foxinmy opened this issue · 1 comments

how to filter the field that value is empty
macek commented

It's not the plugin's job to determine which fields you intend to serialize.

You could try using jQuery.filter to remove inputs that have an empty value, then call serializeObject

$('#my-form :input').filter(function() { return !!this.val(); }).serializeObject();