jQuery serialize remove empty Select
<p>I have a big form, that will be serialized by a jQuery function.</p>

<p>The problem is that I need to remove from this form before being serialized all the empty values.</p>

<p>I found a way to successfully remove all the empty input text fields, but not the selections.</p>

<p>It does not work properly with select dropdowns.</p>

<p>Ceck below:</p>

<pre><code>echo "&lt;script type=\"text/javascript\"&gt;
$(document).ready(function() {
    $('#submForm').validate({ 
        submitHandler: function(form) {
            // Do cleanup first
            $('input:text[value=\"\"]', '#submForm').remove();
            $('select option:empty', '#submForm').remove();
            var serialized = $('#submForm').serialize();
             $.get('".$moduleURL."classes/DO_submission.php', serialized);
            window.setTimeout('location.reload()', 8000);
            return false;
            form.submit(); 
        }
    })
});
</code></pre>

<p>It should completely remove the dropdown selections where the values are empty. Not only the options but the entire select box should not be included in the serialize function.</p>

<p>How do I achieve this?</p>

<pre><code>$('select option:empty', '#submForm').remove();
</code></pre>

<p>This code is not working as it should..</p>
