salmon-church-58191
10/26/2022, 4:30 PMmysterious-toddler-20573
10/26/2022, 4:30 PMsalmon-church-58191
10/26/2022, 4:30 PMsalmon-church-58191
10/26/2022, 4:30 PMmysterious-toddler-20573
10/26/2022, 4:30 PMsalmon-church-58191
10/26/2022, 4:31 PMmysterious-toddler-20573
10/26/2022, 4:31 PMsalmon-church-58191
10/26/2022, 4:31 PMmysterious-toddler-20573
10/26/2022, 4:31 PMmysterious-toddler-20573
10/26/2022, 4:31 PMsalmon-church-58191
10/26/2022, 4:32 PMsalmon-church-58191
10/26/2022, 4:32 PMmysterious-toddler-20573
10/26/2022, 4:32 PMmysterious-toddler-20573
10/26/2022, 4:32 PMmysterious-toddler-20573
10/26/2022, 4:33 PMgorgeous-airport-54386
10/26/2022, 4:33 PMsalmon-church-58191
10/26/2022, 4:34 PMmysterious-toddler-20573
10/26/2022, 4:34 PMmysterious-toddler-20573
10/26/2022, 4:34 PMsalmon-church-58191
10/26/2022, 4:34 PMsalmon-church-58191
10/26/2022, 4:37 PMsalmon-church-58191
10/26/2022, 4:38 PMsparse-psychiatrist-6723
10/26/2022, 4:45 PMboundless-leather-51644
10/26/2022, 5:27 PM<form class="form-horizontal" action="/claim" hx-post="/claim" hx-target="#response" method="POST" hx-swap="beforeend">
to submit a request. The server validates the content and if errors occur they are returned as response using <div class="alert alert-danger"><strong>Error! </strong>" + error + "</div>"
. If the form has been filled correctly, then this message is returned <div class=\"alert alert-success\">Claim created successfully for id: " + claim.id + "</div>"
. The problem is that if I click 2 times on the submit button (1st time with errors and 2nd time with mandatory fields), then the content where the HTML is added is not cleaned as both alert-danger, alert-success are displayed. Is there a way to clean the div where errors or success are displayed between clicks on the button submit
?boundless-vase-80440
10/26/2022, 6:24 PMripe-action-67367
10/26/2022, 6:50 PMhx-target="#errors" hx-swap="innerHTML"
bitter-machine-55943
10/26/2022, 9:13 PMcuddly-keyboard-70746
10/26/2022, 11:34 PMfancy-train-23639
10/27/2022, 1:31 AM<!DOCTYPE html>
<tr hx-swap-oob="afterbegin:#import-container-table-body" hx-preserve="true">
<td>
<img src="/images/icons/caret-right-fill.svg" alt="Right Caret" width="16.0" height="16.0">
</td>
<td>2022-10-27 01:04:15 +0000</td>
<td>Fidelity</td>
<td>Brokerage</td>
<td>File</td>
<td>
<button hx-get="/import/component/import-containers/5B6997DB-602F-4744-A70A-CBDF11C7996F" hx-target="#upload-content" type="button" class="btn btn-link btn-rounded btn-sm fw-bold">View</button>
</td>
</tr>
<input type="file" name="file" class="form-control is-valid" title="" id="id_file" required accept=".csv">
This is (mostly) behaving as expected, but for some reason, the top level tr
element gets chopped off, which I did not expect at all from reading through the doc. Is it maybe an issue that my server responds with a DOCTYPE
directive?salmon-church-58191
10/27/2022, 5:39 AM