Title: Autocomplete Multiple Default Options?
Last modified: March 8, 2018

---

# Autocomplete Multiple Default Options?

 *  Resolved [Andrew Tegenkamp](https://wordpress.org/support/users/andrewteg/)
 * (@andrewteg)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/autocomplete-multiple-default-options/)
 * I’m reading over [https://calderaforms.com/doc/autocomplete-fields/](https://calderaforms.com/doc/autocomplete-fields/)
   but not finding if it’s possible to preset 2 options as selected. For example,
   if I have a list of drinks available, I may want to have both water and coffee
   as default options, with other options like tea, lemonade, juice, etc.
 * Is this possible either with a filter or in the interface?
 * Thanks!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fautocomplete-multiple-default-options%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [Andrew Tegenkamp](https://wordpress.org/support/users/andrewteg/)
 * (@andrewteg)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/autocomplete-multiple-default-options/#post-10053663)
 * I guess a little trial and error is the thing… this seems to work if someone 
   wants to confirm or tell of a way to use “default option” in the interface?
 *     ```
       add_filter( 'caldera_forms_render_get_field', function( $field )  {
       	if ( 'lightsaber_color' == $field[ 'slug' ]  ) {
       		//error_log(print_r($field,true));
       		$data = array('red' => 'Red', 'orange' => 'Orange', 'yellow' => 'Yellow', 'green' => 'Green', 'blue' => 'Blue', 'purple' => 'Purple', 'pink' => 'Pink', 'black' => 'Black');
       		//error_log(print_r($data,true));
       		foreach ($data AS $val => $label) {
       			$field['config']['option'][$val] = array(
       				'value' => $val,
       				'label' => $label,
       			);
       		}
       		//set a default?
       		//$field['config']['default'] = 'pink';
       		//set a lot of defaults?
       		$field['config']['default'] = array('red', 'pink');
       	}
       	return $field;
       });
       ```
   
 *  Plugin Author [Josh Pollock](https://wordpress.org/support/users/shelob9/)
 * (@shelob9)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/autocomplete-multiple-default-options/#post-10053751)
 * Thanks for using Caldera Forms. We do not support multiple defaults for any field
   type at this time. We are working on adding support, hopefully for 1.6.0, but
   that might get pushed to 1.6.1
 * You can follow here:
 * [https://github.com/CalderaWP/Caldera-Forms/pull/2322](https://github.com/CalderaWP/Caldera-Forms/pull/2322)
 *  Thread Starter [Andrew Tegenkamp](https://wordpress.org/support/users/andrewteg/)
 * (@andrewteg)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/autocomplete-multiple-default-options/#post-10053860)
 * Thanks, it is working great through code, and that’s plenty good enough for me
   🙂
 * PS > I’m using the same logic of $field[‘config’][‘default’] = array() as on 
   github there. I’ll try to look there before posting from now on!

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

The topic ‘Autocomplete Multiple Default Options?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/caldera-forms_475846.svg)
 * [Caldera Forms - More Than Contact Forms](https://wordpress.org/plugins/caldera-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/caldera-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/caldera-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/caldera-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/caldera-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/caldera-forms/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Andrew Tegenkamp](https://wordpress.org/support/users/andrewteg/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/autocomplete-multiple-default-options/#post-10053860)
 * Status: resolved