great-cartoon-12331
05/28/2023, 7:30 PMmysterious-toddler-20573
05/28/2023, 8:28 PMapplescript
<div>
<button _="on click remove my parent">Delete</button>
</div>
mysterious-toddler-20573
05/28/2023, 8:28 PMfrom:
modifier for the hx-trigger
attribute? This lets you trigger based on other elements in the DOMnice-cpu-16963
05/28/2023, 8:30 PM.htmx-request
CSS classnice-cpu-16963
05/28/2023, 8:31 PMprehistoric-air-9306
05/28/2023, 8:31 PMmysterious-toddler-20573
05/28/2023, 8:32 PMhx-on
now, but for click events it seems overkill to megray-morning-3453
05/28/2023, 8:50 PMbrash-house-85887
05/28/2023, 9:38 PMdata-initialValue="..."
attributed to any form fields, then on the form's input
event run some hyperscript that compares any field with a data-initialValue
attribute with that field's value
and enable the button if there's a difference.mysterious-toddler-20573
05/28/2023, 9:55 PMinput
event and mark it dirty w/ a class or somethingbrash-house-85887
05/28/2023, 9:58 PMmysterious-toddler-20573
05/28/2023, 10:08 PMapplescript
on input debounced at 200ms
add .btn-disabled to the #submitButton
for field in me
if the field's @data-initialValue is not equal to the field's value then
remove .btn-disabled from the #submitButton then exit
mysterious-toddler-20573
05/28/2023, 10:09 PMbrash-house-85887
05/28/2023, 10:09 PMmysterious-toddler-20573
05/28/2023, 10:10 PMmysterious-toddler-20573
05/28/2023, 10:10 PMmysterious-toddler-20573
05/28/2023, 10:12 PMhttps://cdn.discordapp.com/attachments/725789747212976259/1112503579597619260/image.png▾
mysterious-toddler-20573
05/28/2023, 10:12 PMmysterious-toddler-20573
05/28/2023, 10:12 PMapplescript
on input debounced at 200ms
add .btn-disabled to the #submitButton
for <input, select/> in me
if the field's @data-initialValue is not equal to the field's value then
remove .btn-disabled from the #submitButton then exit
brash-house-85887
05/28/2023, 10:12 PMmysterious-toddler-20573
05/28/2023, 10:12 PMmysterious-toddler-20573
05/28/2023, 10:13 PMhttps://cdn.discordapp.com/attachments/725789747212976259/1112503927351545946/image.png▾
mysterious-toddler-20573
05/28/2023, 10:16 PMapplescript
on input debounced at 200ms
add .btn-disabled to the #submitButton
for field in <[data-initalValue]/> in me
if the field's @data-initialValue is not equal to the field's value then
remove .btn-disabled from the #submitButton then exit
mysterious-toddler-20573
05/28/2023, 10:17 PMbrash-house-85887
05/28/2023, 10:17 PMmysterious-toddler-20573
05/28/2023, 10:17 PMmysterious-toddler-20573
05/28/2023, 10:17 PM< ... />
can be a general CSS selectormysterious-toddler-20573
05/28/2023, 10:18 PMbrash-house-85887
05/28/2023, 10:20 PMis not equal to the
generates an error for me, but is not the
works. Updated the gist with what works. https://gist.github.com/geoffeg/28126ccf63ff958544adf527a81a788b