Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    
    tml_add_form_field( 'register', 'country', array(
        'type' => 'dropdown',
        'label' => 'Country',
        'options' => array(
            'US' => 'United States',
            'CA' => 'Canada',
            //etc
        ),
        'value' => tml_get_request_value( 'country', 'post' ),
    );
    
    Thread Starter kellykz

    (@kellykz)

    Thank you! This works great, but is putting it after the submit button for some reason. Any idea why? My code:

    function add_tml_registration_form_fields() {
    	tml_add_form_field( 'register', 'user_login', array(
    		'type'     => 'text',
    		'label'    => 'Choose a Username',
    		'value'    => tml_get_request_value( 'user_login', 'post' ),
    		'id'       => 'user_login',
    		'priority' => 15,
    	) );
    	tml_add_form_field( 'register', 'first_name', array(
    		'type'     => 'text',
    		'label'    => 'First Name',
    		'value'    => tml_get_request_value( 'first_name', 'post' ),
    		'id'       => 'first_name',
    		'priority' => 15,
    	) );
    	tml_add_form_field( 'register', 'last_name', array(
    		'type'     => 'text',
    		'label'    => 'Last Name',
    		'value'    => tml_get_request_value( 'last_name', 'post' ),
    		'id'       => 'last_name',
    		'priority' => 15,
    	) );
    	tml_add_form_field( 'register', 'membership', array(
    		'type' 		=> 'dropdown',
    		'label' 	=> 'Are you an Active or Retired Member?',
    		'value' 	=> tml_get_request_value( 'membership', 'post' ),
    		'options'	=> array(
    			'1' 	=> 'Active Member',
    			'2' 	=> 'Retired Member', 
    			),		
    	) );
    }
    add_action( 'init', 'add_tml_registration_form_fields' );
    Plugin Author Jeff Farthing

    (@jfarthing84)

    Sorry, you will need to add a priority to the field as well.

    Thread Starter kellykz

    (@kellykz)

    Nevermind, as soon as I posted this I saw I was missing the priority. Thanks again for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Registration Fields – Select (dropdown)’ is closed to new replies.