The hx-post attribute turns an interaction into an HTTP POST request without requiring a full-page navigation. It is especially useful for submitting forms while keeping the response focused on one part of the page. HTMX sends the form data to the URL, then places the returned HTML where hx-target points. section 12.2 section 12.7
Saving an edited room
A form can submit inline with: <button hx-post="{% url 'edit_room_form' room.id %}" hx-target="#room-row-{{room.id}}">Save</button>. Include {% csrf_token %} in the form, because this is a Django POST. If validation succeeds, the view returns show_room.html; HTMX swaps that partial into the targeted row. A Cancel button can use hx-get to restore the non-editing room partial.
