title: Send combination of two input values with htmx
body: <p>I'm writing a simple website with <code>Django</code> and I decided to try <a href="//htmx.org" rel="nofollow noreferrer">htmx</a> library in client side to load html fragments. Now I want to sort lists by different fields, ascending and descending. I have something like this:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;col-auto&quot;&gt;
    &lt;div class=&quot;input-group input-group-sm&quot;&gt;
      &lt;select id=&quot;np-sort-key&quot; name=&quot;key&quot; class=&quot;form-select&quot;&gt;
        &lt;option value=&quot;publish_date&quot; selected&gt;Publish date&lt;/option&gt;
        &lt;option value=&quot;title&quot;&gt;Title&lt;/option&gt;
      &lt;/select&gt;
      &lt;button class=&quot;btn btn-outline-dark&quot; type=&quot;button&quot;&gt;
        &lt;span class=&quot;bi bi-sort-down&quot;&gt;&lt;/span&gt; &lt;!-- bi-sort-up for Asc icon --&gt;
      &lt;/button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I want to add/replace the <code>order_by=&lt;order&gt;&lt;key&gt;</code> query parameter to/in the current url (For example /articles?page=2&amp;order_by=-publish_date.) and send it back to Django view both on &quot;select&quot; change and &quot;button&quot; click. The endpoint returns a Html I want to swap it with another Html node with Htmx. (Note that span class should be changed on button click to show sorting is Asc or Dsc)</p>
  <p>Is it possible using <code>htmx</code>? If not, simple Javascript solutions are welcome.</p>