Title: Radio Buttons (Multiple Options)
Last modified: August 30, 2016

---

# Radio Buttons (Multiple Options)

 *  [Netzdepp](https://wordpress.org/support/users/netzdepp/)
 * (@netzdepp)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/radio-buttons-multiple-options/)
 * Is there a possibility to use Radio Buttons with the registration form of WP 
   Members?
 * Alternatively, I’d like to have a Dropdown menu with multiple choices. Is this
   possible in WP Members?
 * Thank you,
    Markus
 * [https://wordpress.org/plugins/wp-members/](https://wordpress.org/plugins/wp-members/)

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

 *  Thread Starter [Netzdepp](https://wordpress.org/support/users/netzdepp/)
 * (@netzdepp)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/radio-buttons-multiple-options/#post-6649525)
 * Can nobody help?
 * Ain’t there any options how I can use a dropdown or a radio button with multiple
   selection?
 *  Plugin Author [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * (@cbutlerjr)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/radio-buttons-multiple-options/#post-6649531)
 * There is not a radio button or multiselect option native in the plugin at this
   time (although I am working on redesigning the fields and forms during the 3.
   x lifecycle – I expect 3.1 or 3.2 to support additional form input types).
 * Generally, the way to approach it currently is to add the field as a regular 
   text input field (essentially as a placeholder) and then use the [wpmem_register_form_rows ](http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/wpmem_register_form_rows)
   filter to change the HTML for the field.
 * I haven’t tried it, and it might take some additional processing for managing
   the data, but the simplest for a multiple select dropdown would be to create 
   it as a dropdown and then use that same filter to add the “multiple” attribute
   and make the name attribute an array (to pass all selected items):
 *     ```
       add_filter('wpmem_register_form_rows', 'my_form_rows');
       function my_form_rows($rows){
   
       	// use str_replace to add in "multiple" to the select tag and change
       	// the name attribute to pass an array where 'test_field' is the
       	// option name of the field being filtered
       	$old = '<select name="test_field"';
       	$new = '<select multiple name="test_field[]"';
       	$str = $rows['test_field']['field'];
       	$rows['test_field']['field'] = str_replace( $old, $new, $str );
   
       	return $rows;
       }
       ```
   
 * To handle the posted data as a single string, I would use the [wpmem_register_data ](http://rocketgeek.com/plugins/wp-members/users-guide/filter-hooks/wpmem_register_data/)
   filter to implode the posted test_field[] array into comma separated values:
 *     ```
       add_filter('wpmem_register_data', 'my_form_rows_post');
       function my_form_rows_post( $fields ) {
       	if ( isset( $_POST['test_field'] ) ) {
       		$fields['test_field'] = '"'.implode( '","', $_POST['test_field'] ).'"';
       	}
       	return $fields;
       }
       ```
   
 * There would probably need to be some additional considerations for displaying
   the data on the admin side user profile, but this would at least capture the 
   data.

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

The topic ‘Radio Buttons (Multiple Options)’ is closed to new replies.

 * ![](https://ps.w.org/wp-members/assets/icon-256x256.png?rev=1226414)
 * [WP-Members Membership Plugin](https://wordpress.org/plugins/wp-members/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-members/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-members/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-members/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-members/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-members/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/radio-buttons-multiple-options/#post-6649531)
 * Status: not resolved