Title: Dropdown value plus two references
Last modified: June 14, 2022

---

# Dropdown value plus two references

 *  [den1sa](https://wordpress.org/support/users/den1sa/)
 * (@den1sa)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/dropdown-value-plus-two-references/)
 * Hi,
 * I am trying to create a clothing size dropdown that will provide conversion sizes
   for UK, EU and US and upon a selection will add a value set for each option.
 * So for example,
 * Value —– UK — EU — US
    4 ——- 4 — 34 — 37 5 ——- 5 — 36 — 39 6 ——- 6 — 38 — 41
 * So if say a user is from the UK and is a UK size 5, the dropdown list shows the
   equivalent to the same in EU(36) and US(39), the value stored in the database
   is 5.
 * This is handy to provide the conversion for users in the EU and US without a 
   separate conversion table.
 * Can anyone show me how this may be achieved.
 * Thanks,
 * Denis

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [Aswin Giri](https://wordpress.org/support/users/aswingiri/)
 * (@aswingiri)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/dropdown-value-plus-two-references/#post-15738372)
 * Hello [@den1sa](https://wordpress.org/support/users/den1sa/)
 * To achieve your requirement you will need an “IP to Location” service or You 
   will need a field where users will select their country.
 * Secondly, you will need to make modifications to choices within the “Choice Callback”
   function based on the user’s country. Please [check this documentation ](https://docs.ultimatemember.com/article/1486-how-to-use-choices-callback)
   about UM dropdown Choices Callback.
 *  Thread Starter [den1sa](https://wordpress.org/support/users/den1sa/)
 * (@den1sa)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/dropdown-value-plus-two-references/#post-15739007)
 * Hi Aswin,
 * I think i didn’t explain myself very well, sorry about that.
 * If i provide another example thats doesn´t relate to country, i think it will
   be better to understand what I am asking for.
 * If a user clicks on the dropdown list they are presented with the following;
 * A value which is stored in the database and a description which is for reference
   only.
 * Value = 8
    Reference = Small
 * so i need it to look like this …
 * 8 – Small
    10 – Small 12 – Medium 14 – Medium 16 – Large … and so on.
 * So when I search for clothing size, I can filter clothing size that is between
   8 and 10 only for example which is why i only need the value stored.
 * I hope this helps to understand my requirement.
 * Thanks,
 * Denis
    -  This reply was modified 3 years, 11 months ago by [den1sa](https://wordpress.org/support/users/den1sa/).
 *  Plugin Support [Ultimate Member Support](https://wordpress.org/support/users/ultimatemembersupport/)
 * (@ultimatemembersupport)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/dropdown-value-plus-two-references/#post-15745466)
 * Hi [@den1sa](https://wordpress.org/support/users/den1sa/)
 * Have you tried using the Choices Callback function so you can separate the Labels
   and Values? Here’s an example code snippet:
 *     ```
       function my_cloething_size_list_dropdown() {
         $arr_sizes = array(
         "8"=>"Small",
         "10"=>"Small",
         "12"=>"Medium",
         "14"=>"Medium",
         "16"=>"Large",
         );
         return $arr_sizes;
       }
       ```
   
 * Regards,
 *  Thread Starter [den1sa](https://wordpress.org/support/users/den1sa/)
 * (@den1sa)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/dropdown-value-plus-two-references/#post-15747749)
 * Hi.
 * Thank you for your suggestion. I am not sure I understand this. I am trying to
   avoid having to use a table and list the corresponding description per line. 
   So the user sees a dropdown that looks like this.
 * 8 – Small
    10 – Small 12 – Medium 14 – Medium 16 – Large
 * and so on…
 * So i need both values to show up in the dropdown, but only the numerical value
   stored.
 * Does what you suggested achieve this? If not, is this doable?
 * Thanks in advance.
 * Denis
    -  This reply was modified 3 years, 11 months ago by [den1sa](https://wordpress.org/support/users/den1sa/).
 *  Thread Starter [den1sa](https://wordpress.org/support/users/den1sa/)
 * (@den1sa)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/dropdown-value-plus-two-references/#post-15757539)
 * Bump. Can anyone offer any suggestions?
 *  Plugin Support [Ultimate Member Support](https://wordpress.org/support/users/ultimatemembersupport/)
 * (@ultimatemembersupport)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/dropdown-value-plus-two-references/#post-15759869)
 * Hi [@den1sa](https://wordpress.org/support/users/den1sa/)
 * Sorry for the late response.
 * You can try the following Choices callback function. It will display the size
   and text as option labels but stores only the size number to the database:
 *     ```
       function my_cloething_size_list_dropdown() {
         $arr_sizes = array(
         "8"=>  "8 - Small",
         "10"=>"10 - Small",
         "12"=>"12 - Medium",
         "14"=>"14 - Medium",
         "16"=>"16 - Large",
         );
         return $arr_sizes;
       }
       ```
   
 * Please see the steps here to add the choices callback function:
    [https://docs.ultimatemember.com/article/1486-how-to-use-choices-callback](https://docs.ultimatemember.com/article/1486-how-to-use-choices-callback)
 *  Thread Starter [den1sa](https://wordpress.org/support/users/den1sa/)
 * (@den1sa)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/dropdown-value-plus-two-references/#post-15766569)
 * Thank you, i have now entered this in my code.
 * Can you please confirm that the value stored is stored as a number, so I can 
   for example filter clothing size to only show between 12 – 16 only?
    -  This reply was modified 3 years, 11 months ago by [den1sa](https://wordpress.org/support/users/den1sa/).

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Dropdown value plus two references’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [den1sa](https://wordpress.org/support/users/den1sa/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/dropdown-value-plus-two-references/#post-15766569)
 * Status: not resolved