You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I love that we can use CSS selectors for many things in the htmx world. So nice! But, as I'm learning about the hx-disabled-elt functionality, I'm feeling like there's a middle ground for something that's not supported. Considering wanting to disable all the buttons inside a form during a submissions process. I have two obvious options:
<form hx-disabled-elt="find button" - disables the first button it finds.
<form hx-disabled-elt="button" - disables all buttons, even if not inside the form.
There's no easy way to disable all buttons inside a form without having to add an id to the form itself and then use that in the selector:
Ha, great minds think alike ☺️ Ok, I will close this discussion since it seems like it's already been discussed. Strange that it didn't get more traction (especially for something that is a 2-line change (based on that PR).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I love that we can use CSS selectors for many things in the htmx world. So nice! But, as I'm learning about the
hx-disabled-eltfunctionality, I'm feeling like there's a middle ground for something that's not supported. Considering wanting to disable all the buttons inside a form during a submissions process. I have two obvious options:<form hx-disabled-elt="find button"- disables the first button it finds.<form hx-disabled-elt="button"- disables all buttons, even if not inside the form.There's no easy way to disable all buttons inside a form without having to add an
idto the form itself and then use that in the selector:<form id="my-form" hx-disabled-elt="#my-form button"It would be great if either we could add a
findall/findmanythat would do a relative CSS search, but not stop at the first element:<form hx-disabled-elt="findall button"Or, maybe allow the
thishelper to be used as the root of a CSS selector path (like hownextandpreviouswork). Then would just do:<form hx-disabled-elt="this button"Just throwing that out there as an idea to make this a tiny bit easier.
All reactions