Buy Now
Sign in

Wrong selected value in Dropdown

Lorentz , May 15 at 12:31
Answered
L
Lorentz
Hi,
I looked up informations in FAQ and forum about the field Selected Value in drop down field but I found nothing solving (one of) my problem(s).
If I set a selected value (with php or custom form), I never get the right key/value expected.
To make tests, I tried with a simple dropdown. Originally, options are fed by a read_data key/value but I did it manually for this example below.
Dropdown_selection_fail_1.JPG
By this way, I thought the dropdown would display le label "21", 22 being the key, or would display 22 like I wrote in the field (and the value key 23).
But this is the result :
Dropdown_selection_fail_2.JPG
I've changed the multi select dropdown option to YES and I don't understand the result :
Dropdown_selection_fail_3.JPG
I only put one value in the selected value list and there is three selected.
Any idea of what I did wrong ?
Thanks
L
Lorentz
Hi,
I am still stuck on this.
No one see the mistake i've done ?
L
Lorentz
Well, still stuck ...
I did quite a lot of tests without results and hardly I think I've found a way to identify the problem but I don't know how to solve it.
I did this options List and selected in a dropdown :
Dropdown_test180517_list.JPG
the result is :
Dropdown_test180517_result.JPG
I identify two problems :
  1. dropdown doesn't use my argument "07" as is, means like a string, It probably changes it before the array search in a numeric value : 7. This is why it doesn't offer me the options 10=07.
  2. I can't specify where to look, key or field, and it seems to do both, so I obtain the image result above.
How can I solve this problem ?
Attachments
Dropdown_test180517_list.JPG
Dropdown_test180517_list.JPG
(24.18 KiB)
74 Downloads/Views
Dropdown_test180517_result.JPG
Dropdown_test180517_result.JPG
(9.59 KiB)
73 Downloads/Views
L
Lorentz
I partially solved my problem using a CONCAT in field to retrieve in the read_data feeding the dropdown.
In my case :
id​
​Concat(departement_code , ' ' , departement_nom)
instead of
id​
​departement_code
In this way, there's no more unique integer in the value field of the dropdown and no more problems.
So I put this topic on "answered" even if it's not really the case ...
Either I missed something and I don't understand how to fully use the dropdown arguments
Or it's an unexpected behaviour that need to be solved in an update ...
I hope I'll know one day ...
Thanks for the support ...