Make clean form submitted urls using Javascript
<p>I want to create a url in the form of domain.com/?product=value1&amp;product2=value2.....</p>

<p>Sometimes the textboxes may not have values in it. How can I ignore those forms elements using Javascript? </p>

<p>I want to avoid the <code>domain.com/?product=&amp;product2=abs&amp;product3=&amp;product4=</code></p>

<p><strong>my form</strong></p>

<pre><code>    &lt;form action="customsearch.php"&gt;

    &lt;input type="text" class="textfield" value="" id="product" name="product"&gt;
    &lt;input type="text" class="textfield" value="" id="product2" name="product2"&gt;
.
.
.    
    &lt;input type="submit" value="Send"&gt;

    &lt;/form&gt;
</code></pre>
