busy-tomato-43957
11/20/2022, 1:29 AMhtml
<fieldset class="filter" hx-swap="this">
<legend>"Filter"</legend>
<input type="radio" id="filter-all" name="filter" value="All" checked={ selected_filter == All } hx-post="/todos;filter=All" />
<label for="filter-all">"All"</label>
<input type="radio" id="filter-active" name="filter" value="Active" checked={ selected_filter == Active } hx-post="/todos;filter=Active" />
<label for="filter-active">"Active"</label>
<input type="radio" id="filter-completed" name="filter" value="Completed" checked={ selected_filter == Completed } hx-post="/todos;filter=Completed" />
<label for="filter-completed">"Completed"</label>
</fieldset>
mysterious-toddler-20573
11/20/2022, 3:00 AMmysterious-toddler-20573
11/20/2022, 3:01 AMmysterious-toddler-20573
11/20/2022, 3:01 AM/todos
and then the entire fieldset is re-rendered. As long as the HTML that comes down has the correct option selected, it should work.mysterious-toddler-20573
11/20/2022, 3:03 AMmysterious-toddler-20573
11/20/2022, 3:03 AMchecked
A Boolean attribute which, if present, indicates that this radio button is the default selected one in the group.
freezing-waitress-26396
11/20/2022, 5:32 AMvictorious-match-64854
11/20/2022, 12:10 PMboundless-vase-80440
11/20/2022, 12:13 PMmysterious-toddler-20573
11/20/2022, 2:03 PMvictorious-match-64854
11/20/2022, 2:04 PMmysterious-toddler-20573
11/20/2022, 2:06 PMvictorious-match-64854
11/20/2022, 2:06 PMorange-nail-40296
11/20/2022, 10:49 PMbusy-tomato-43957
11/21/2022, 12:47 AMancient-angle-7831
11/21/2022, 2:28 AMhx-preserve
while doing a hx-swap-oob="true"
?
Because I can't seem to get it to preserve an element on the page (same component ID)busy-tomato-43957
11/21/2022, 6:15 AMancient-angle-7831
11/21/2022, 7:07 AMmysterious-toddler-20573
11/21/2022, 1:41 PMboundless-leather-51644
11/21/2022, 2:22 PMboundless-leather-51644
11/21/2022, 2:23 PMmysterious-toddler-20573
11/21/2022, 2:33 PM204 - No Content
is treated as "nothing to swap". You can modify how other response codes are handled as outlined here: https://htmx.org/docs/#modifying_swapping_behavior_with_eventsboundless-leather-51644
11/21/2022, 3:35 PMhundreds-dusk-97323
11/21/2022, 4:13 PMboundless-leather-51644
11/21/2022, 5:18 PMedit
button. When we click on it we do a GET (= server logic will check if an entity exists). If there is an entity within the DB then we should forward the request to a new screen to edit the entity ?mysterious-toddler-20573
11/21/2022, 5:34 PMmysterious-toddler-20573
11/21/2022, 5:35 PMmysterious-toddler-20573
11/21/2022, 5:35 PMmysterious-toddler-20573
11/21/2022, 5:36 PMboundless-leather-51644
11/21/2022, 5:39 PM