I have a simple form that goes on to create all the form and validation requirements for codeigniter. What I want to do is filter out any empty inputs prior to serializatio
This will remove all the text fields which have a value of length 0:
$('#send').click(function(){ $(':input[type="text"]').filter(function(e){ if (this.value.length===0){ return true; } }).remove(); });
example: http://jsfiddle.net/niklasvh/ZBSyX/