Buy Now
Sign in

Wrong selected value in Dropdown

Lorentz , May 15 2018
Lorentz 38
May 15 2018 #377693
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.
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 :
I've changed the multi select dropdown option to YES and I don't understand the result :
I only put one value in the selected value list and there is three selected.
Any idea of what I did wrong ?
Lorentz 38
May 16 2018 #377713
I am still stuck on this.
No one see the mistake i've done ?
Lorentz 38
May 17 2018 #377728
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 :
the result is :
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 ?
(24.18 KiB)
145 Downloads/Views
(9.59 KiB)
143 Downloads/Views
Lorentz 38
May 18 2018 #377765
I partially solved my problem using a CONCAT in field to retrieve in the read_data feeding the dropdown.
In my case :
Concat(departement_code , ' ' , departement_nom)
instead of
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 ...