Select Option Value not displayed in form input

What makes using Wappler constantly refreshing for me is forgetting how to do something I routinely did in a project in 2021.

So I show up with a newbie question –
In a form I’ve made a Select Menu which gets its options values in a list form from a query of a table of those values in an API.

The list is available on page load and only allows the form user to click one of the displayed options above the field to fill in the “Story ort” input below the list of options.

I want the user to click one of those text lines and then see the input “Story ort” display the selected text value.

Of course, I’m here because that is not happening. Click, click on options does not display the value selected in the input.

So, if you would, please show me where my code is off-track –

I notice your select input dynamic value is wrong. It can’t be selectedText+value - it must be a dynamic value coming from a database. This is not correct at all:

If you are not getting a dynamic value from the database, don’t use this option.
Also remove {{selectedText+value}} between <select> and </select> it’s wrongly added there and it cannot be there.

Here is what I had tried before –

Please post your code instead of posting screenshots. We can’t copy and paste from screenshots.

Check my reply please. Your select setup is wrong:

Also remove this onclick dynamic event … that is also wrong.

I have problems with Firefox posting code here.

Over and over, whether block or quote options…
some days it works here and today, again, it will not display two blocks

All you need to select for your select is just data source, text and value:

Nothing more is required for the dynamic select to work.

You just need to format your code … How to format code in your posts

Actually creating a dynamic select is pretty well explained in our docs:

The page you reference is exactly where I started.

It is missing a couple of steps for me —
It makes a Dynamic Select Menu – just fine, I got that.
However it stops short of what I needed.
I needed to see the next steps –
How to assign the Dynamic Select Menu selection On-Mouse-Click to the input value of a another input for an insert-into-table query.

I couldn’t find the tutorial that would have taken me further.
I assumed after going through this page that the selection action would be a ON CLICK of the mouse that would pass the selected value into the target input in my form.

That is why I stumbled around trying to pass the Menu selection into another Input on my form and see that value displayed in that input. The dynamic menu fetched from a table named “story_ort” needs to pass its selected value into a field in my form that has the same name – story_ort

Aha ok - you don’t assign it on click :slight_smile: You can just select the text input > dynamic attributes > value > select the select input.value here.
This will show the selected value in the text input.

1 Like

That was IT!

Thank you, @Teodor for nailing that down for me!

I will put this into my procedures to keep in my head from now on!
Thank you, again… Now I see the logic. :nerd_face:

Corrected and working –

<label for="inp_story_ort" class="ps-2">Story ort</label>
<select id="select2" class="form-select pt-1 pb-1 form-control-lg" multiple="true" dmx-bind:options="sc_story_ort.data.custom_story_ort" optiontext="story_ort" optionvalue="story_ort" dmx-bind:value="inp_story_ort.value">
</select>
  <input type="text" class="form-control" id="inp_story_ort" name="story_ort" aria-describedby="inp_story_ort_help" placeholder="Enter Story ort"  dmx-bind:value="select2.value">

Screenshot 2022-04-04 at 18.13.34

1 Like