mysterious-toddler-20573
01/30/2023, 4:24 PMmysterious-toddler-20573
01/30/2023, 4:25 PMmysterious-toddler-20573
01/30/2023, 4:26 PMHX-Trigger
response header, causing the row in question to refreshrich-coat-84078
01/30/2023, 4:27 PMmysterious-toddler-20573
01/30/2023, 4:27 PMmysterious-toddler-20573
01/30/2023, 4:28 PMmysterious-toddler-20573
01/30/2023, 4:29 PMmysterious-toddler-20573
01/30/2023, 4:29 PMrich-coat-84078
01/30/2023, 4:33 PMmysterious-toddler-20573
01/30/2023, 4:35 PMlively-waitress-29714
01/30/2023, 4:49 PMrich-coat-84078
01/30/2023, 5:02 PMthousands-teacher-15959
01/30/2023, 5:12 PMhtml
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.full.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
<script src="https://unpkg.com/htmx.org@1.8.5"></script>
<select name="collection" class="form-select "id="collection-select" data-placeholder="Choose Collection"
hx-get="/some-endpoint"
hx-target="#test"
hx-swap="innerHTML"
>
<option></option>
<option>Algoritm</option>
<option>Holistic</option>
<option>Solution</option>
<option>Conglomeration</option>
</select>
<div id="test">Test123</div>
<script>
$("#collection-select").select2({
theme: "bootstrap-5",
closeOnSelect: true
});
</script>
Using Flask (Python) as my server, but no problems on that end, because I've been using htmx successfully so far with everything else, so it's definitely select2 relatedthousands-teacher-15959
01/30/2023, 5:16 PMmysterious-toddler-20573
01/30/2023, 5:24 PMrich-coat-84078
01/30/2023, 8:54 PMhtmx.on
click
works 1 time and then stops working. I may not have seen it due to extreme fatigue, I wonder if anyone can see why?
(function(){
htmx.defineExtension('set-update', {
onEvent : function(name, evt) {
if (name === "htmx:afterRequest") {
setBodyClasses(evt)
}
if (name === "htmx:afterOnLoad") {
htmx.on("#unset_update", "click", function(evt) {
unSetBodyClasses()
});
}
}
});
function setBodyClasses(evt) {
htmx.addClass(htmx.find('body'), 'update-On');
}
function unSetBodyClasses() {
htmx.removeClass(htmx.find('body'), 'update-On');
}
})();
mysterious-toddler-20573
01/30/2023, 9:55 PMmysterious-toddler-20573
01/30/2023, 9:56 PMrich-coat-84078
01/30/2023, 10:02 PM<button
...
hx-ext="set-update">update</button>
future-jewelry-30383
01/30/2023, 11:14 PMname
form values are duplicated for the first checkbox. One value from the regular form, one value from the identical hidden mobile menu: brands[]="honda,honda,stihl"
.
And when I uncheck a checkbox, it doesn't happen, because one form is still sending the checked param value. Is there any creative solution? Ideally I want to ignore form A when form B is clicked; or I should sync the forms in the frontend before the htmx swap happens... Or use unique param names for each form?
Things get ugly quick. I tried hx-sync="closest form:abort"
(but not the right use-case?) and hx-params
(but param name is the same) and setting hx-disable
on the mobile menu to disable it when it's not in use, but it still sends its params along.damp-lamp-34714
01/31/2023, 12:33 AMeager-city-40681
01/31/2023, 12:42 AMlate-king-98305
01/31/2023, 12:43 AMeager-city-40681
01/31/2023, 12:45 AMeager-city-40681
01/31/2023, 12:46 AMdamp-lamp-34714
01/31/2023, 12:47 AMlate-king-98305
01/31/2023, 12:47 AMlate-king-98305
01/31/2023, 12:50 AMid
attribute of new-user
. If you're wanting it to put the results of the POST into that element, you'll want to define an empty element in your initial page.damp-lamp-34714
01/31/2023, 12:51 AM