gorgeous-airport-54386
05/06/2023, 3:38 PMgorgeous-airport-54386
05/06/2023, 3:38 PMquick-garage-13170
05/08/2023, 2:14 PMhttps://cdn.discordapp.com/attachments/931549069141225613/1105135715941101608/iu.png▾
quick-garage-13170
05/08/2023, 2:28 PMbitter-machine-55943
05/08/2023, 2:35 PMquick-garage-13170
05/08/2023, 2:41 PMhttps://cdn.discordapp.com/attachments/931549069141225613/1105142381206061076/image.png▾
shy-zebra-22292
05/08/2023, 3:55 PMfor each ( db_results as db_result )
if (db_result.name is in selected_items_list)
display checkmark + db_result.name
else
display empty checkmark + db_result.name
gentle-salesclerk-37089
05/08/2023, 6:51 PMquick-garage-13170
05/08/2023, 7:05 PMrefined-waiter-90422
05/08/2023, 7:08 PMshy-zebra-22292
05/08/2023, 7:08 PM<input type="checkbox" name="animal[]" value="Cat" />
<input type="checkbox" name="animal[]" value="Dog" />
<input type="checkbox" name="animal[]" value="Bear" />
and hx-include the whole <form>
note the name is the same and ends with []
like animal[]
on the backend you will receive this as a list in a single "property"/"variable". in php that would be something like $_POST['animal']
I can imagine Node.js/Express would be req.body.animal
(again, an array of animal names) etc.refined-waiter-90422
05/08/2023, 7:19 PMgorgeous-airport-54386
05/08/2023, 7:19 PMgorgeous-airport-54386
05/08/2023, 7:20 PMrefined-waiter-90422
05/08/2023, 7:21 PMrefined-waiter-90422
05/08/2023, 7:27 PMrefined-waiter-90422
05/08/2023, 7:36 PMgorgeous-airport-54386
05/08/2023, 7:36 PMgorgeous-airport-54386
05/08/2023, 7:36 PMfancy-oil-15534
05/11/2023, 4:17 AMbitter-baker-28217
05/11/2023, 6:40 AMbitter-machine-55943
05/11/2023, 12:51 PMbitter-baker-28217
05/11/2023, 12:53 PMstrong-addition-37567
05/11/2023, 5:18 PMstrong-addition-37567
05/11/2023, 5:20 PM// activates any alpine directives in new content loaded by htmx
htmx.onLoad((elt) => {
Alpine.initTree(elt)
})
in our window.addEventListener("load", function() {
so that alpine processes any new html loaded from htmxkind-jordan-22489
05/19/2023, 7:18 PM@htmx:pushedIntoHistory.document="doSomething()"
it seems to ignore it. Maybe alpine gets confused by the : in the eventname? Any way around this?astonishing-teacher-48635
05/25/2023, 10:25 PMastonishing-teacher-48635
05/25/2023, 10:25 PMmost-jelly-15242
05/25/2023, 10:41 PMhtml
x-data="{foo: 'bar'}"
x-bind:hx-vals="JSON.stringify({'foo': foo})"
I put that directly on a button and foo=bar
is included in the request payload.millions-apartment-38225
05/26/2023, 2:35 PM@htmx:pushed-into-history.camel
https://alpinejs.dev/directives/on#camel