I have two custom pre-built lists.
One is a listing of states which when used comes in as
Arizona|Arizona
etc...
The other list is of locations which when used comes in as
0|AK - Elmendorf AFB (1234 FIGHTER DRIVE)
1|AK - Fort Richardson (5678 "X" STREET)
etc.....
I have tried manually formatting the listing in key|value pairs with custom keys but it just comes in as
0|AKElmendorfAFB1234FIGHTERDRIVE|AK - Elmendorf AFB (1234 FIGHTER DRIVE)
1|AKFortRichardson5678XSTREET|AK - Fort Richardson (5678 "X" STREET)
How do I control the 'value' to be the same string value as the 'display' (like on my states list) as this list is dynamic and has 100s of entries? A value of '0' is meaningless as there is no fixed reference.
Thanks for any assistance.
Comments
Comment #1
ksavoie CreditAttribution: ksavoie commentedComment #2
ksavoie CreditAttribution: ksavoie commented[SOLUTION]
Found the solution after finding this post
https://groups.drupal.org/node/71588
The arrays element name becomes the 'key'
i.e. $myarray[$someUniqueKey] = $myValue;
Comment #3
quicksketchThanks for the followup @ksavoie.