Dropdown component #692
Replies: 3 comments 4 replies
-
Beta Was this translation helpful? Give feedback.
-
@YunusMechery If what you are trying to achieve is to bind a selection element from the dropdown, I have a functional version. If you absolutely want to set the selected_staff variable via 'post', ignore what I wrote :) dropdown.handlebars
dropdown.sql
the element with the id 'selected_staff' is linked to the option selected in the dropdown and changes without refreshing the page |
Beta Was this translation helpful? Give feedback.
-
Tada! problem solved! I had to remove colon infront of :selected_staff name parameter to simply 'selected_staff' in single quotes. SELECT 'dropdown' AS component
, 'Select an item' AS title
, '?' AS on_change
, 'selected_staff' AS name; |
Beta Was this translation helpful? Give feedback.
-
I've created a custom component named dropdown and used htmx to do a post to the same page when selection changes. But its not working as expected. It refreshes the page successfully on selection change but the POST parameters not having the values.
This setup was working when using form component's dropdown. Is it mandatory to have a form for custom components?
I was confused where to post this, in htmx forums or sqlpage. I thought will start from here as the POST on change working fine. Only thing values not getting in the POST parameters. I tried to display using both :var and $var.
If htmx causing problems, is there a way to achieve this in SQLPage itself.
dropdown.handlebars
dropdown.sql
Beta Was this translation helpful? Give feedback.
All reactions