Skip to content

Creating a list of select options #3

@starapple2

Description

@starapple2

Not an issue but seeking info. Is their any guidance I can find on adding a select box with a list of options? I have an array of country codes and countries I'd like to present as a Country List generated by:

$countries = array(
  'gb' => 'Great Britain',
  'us' => 'United States',
  ...);

   foreach($countries as $code => $country):
        echo '<option value="'.$code.'">'.$country.'</option>'; 
    endforeach;

I've followed the instructions to display a Field Group choice, Country Select but need to know how to set the list of countries and offering the choices for the Return Value.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions