• Hi there,
    Im using yor plugin with satisfaction, but I have a question for you.
    I need to have a dropdown dynamically generated from a text box field in a registration form. Ref: Luogo (city) field
    Example a new user inserts its city in the registration form and that data is taken automatically in the search dropdown field. Registration field > New York > ok, New York now is automatically in the homepage dropdown search field.
    I’m asking for your help because cannot write an endless list of cities using a multi select registration field.
    I hope there is a solution from your plugin.
    Thank you

    • This topic was modified 4 years, 7 months ago by Yui.
    • This topic was modified 4 years, 7 months ago by Yui. Reason: extra link deleted

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter martyn

    (@marty2010)

    Populating a drop down list from specific Ultimate Member registration form field or profile form field (meta key, id).
    Is my intuition right?

    function field_choices( $field ) {  
    
        $field['luogo'] = array();   
    
        $choices = get_field('my_select_values', 'option', false);
    
        $choices = explode("\n", $choices);   
    
        $choices = array_map('trim', $choices);
    
        if( is_array($choices) ) {      
            foreach( $choices as $choice ) {           
                $field['luogo'][ $choice ] = $choice;           
            }       
        }   
        // return the field
        return $field;    
    }
    add_action('um_get_members', 'field_choices');
    • This reply was modified 4 years, 7 months ago by martyn.
    • This reply was modified 4 years, 7 months ago by martyn.
Viewing 1 replies (of 1 total)
  • The topic ‘Dropdown dynamically generated’ is closed to new replies.