Dropdown component #692
Closed
YunusMechery
started this conversation in
General
Replies: 3 comments 4 replies
1 reply
|
@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 |
1 reply
|
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; |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
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
All reactions