htmx
htmx copied to clipboard
hx-indicator not working as expected
When either of the buttons is clicked, the indicators on both buttons appear because the hx-request is being added to the form and not the specified id ( #indicator1 or #indicator2 ). I am using version 2.02
<form hx-post="/submit">
<button action="submit" name="action" value="action1" hx-indicator="#indicator1">
Button 1
<span id="indicator1" class="htmx-indicator">🔄</span>
</button>
<button action="submit" name="action" value="action2" hx-indicator="#indicator2">
Button 2
<span id="indicator2" class="htmx-indicator">🔄</span>
</button>
</form>