Search form - Passing only field params that are not empty or selected Is it possible to have a search form pass (into the search query) the field params of only fields that have been populated/selected? For example, if the following form is submitted, both q and color params are passed in the receiving template to which the form submits.
&lt;form action=&quot;{{ url('search/results') }}&quot;&gt;
    &lt;input type=&quot;search&quot; name=&quot;q&quot;&gt;
    &lt;select name=&quot;color&quot;&gt;
        &lt;option value=&quot;&quot;&gt;Select a Color&lt;/option&gt;
        &lt;option value=&quot;black&quot;&gt;Black&lt;/option&gt;
        &lt;option value=&quot;white&quot;&gt;White&lt;/option&gt;
    &lt;/select&gt;
    &lt;input type=&quot;submit&quot; value=&quot;Go&quot;&gt;
&lt;/form&gt;

Output URL: http://mydomain.com/people/results?q=&amp;color=
I have a search form that includes a lot of fields, so I want to only pass the params that are not empty or have been selected. This way, the URL that's passed is cleaner and less monstrous.
So in the example above, if the color dropdown isn't selected, the output URL would be http://mydomain.com/people/results?q=somequerystring
That's just the way forms work in html. If you don't want to use a POST method, (because that would make the results not URL-addressable at all), I'd recommend using an intermediary Twig template to perform a redirect based on what parameters exist - i.e., set your form action to search/process and in that template write a load of conditional statements to build up a query string to pass into a {% redirect %} tag which loads search/results.
If you don't want two templates, you could instead set your form method to POST and then in your search/results template you could conditionally perform a redirect to the same template appended with your custom query string, and use craft.app.request.method to distinguish between the request types to avoid an inifinte redirect loop.