Support

Account

Home Forums Front-end Issues Show select value of dynamically populated menu Reply To: Show select value of dynamically populated menu

  • The main problem you have is that you’re using an options page for your companies and there’s really no way to reliably get the company name without once again looping through your repeater and checking each row of the repeater to see if the company matches.

    But then you have to think about what happens if you ever have to change the company name. This will cause the value that the user chose for company to not match anything.

    A better plan would be to use a custom post type (https://codex.wordpress.org/Post_Types#Custom_Post_Types) for the companies and then you can use a post object field for the user to select a company. This would be much easier in the long run to manage and to code for.