PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Drop Down Show Search Input Field

  1. ehong33234
    Member

    Can't figure out why my GF woo product add-ons drop down options all have the "search" input field as the first option. It should only be the drop down options showing. Any suggestions?

    Screenshot: http://oi45.tinypic.com/6fzdeb.jpg

    Thanks!

    Posted 11 years ago on Tuesday December 4, 2012 | Permalink
  2. Richard Vav
    Administrator

    That is normal when you activate the enhanced user interface for the drop down, I am not sure if the chosen plugin gravity forms are using for the enhanced user interface provides a way of disabling the search field. That said you may try using css to hide it if you really don't want it by adding something like this to your themes style.css

    .chzn-search { display: none; }

    Edit:
    According to the following topic over on the chosen scripts issue tracker it looks like they added the ability to disable the search field a few months back by passing the parameter "disable_search: true", but I don't think the chosen scripts included with gravity forms have been updated in a while so until they are updated in a future version of gravity forms I think your only option is to use the css above.

    https://github.com/harvesthq/chosen/issues/772

    Posted 11 years ago on Tuesday December 4, 2012 | Permalink
  3. ehong33234
    Member

    Hey Richard, thanks a ton. I'll give that a shot.

    Can I put that directly into the form field CSS properties or should I do it in my custom.css using editor?

    Posted 11 years ago on Tuesday December 4, 2012 | Permalink
  4. ehong33234
    Member

    just added the following code to the custom css input field in my woothemes (mystile) dashboard and it did the trick.

    }
    .chzn-search { display: none; }
    }

    Posted 11 years ago on Wednesday December 5, 2012 | Permalink
  5. Richard Vav
    Administrator

    good to hear you got it sorted.

    Posted 11 years ago on Wednesday December 5, 2012 | Permalink
  6. Richard Vav
    Administrator

    Just to update this topic you can also use the filter gform_chosen_options to disable the enhanced user interface search feature when less than a set number of options are present or altogether.

    You would add the following to your functions.php file

    add_action('gform_pre_render','set_chosen_options');
    function set_chosen_options($form){
    ?>
    <script>
    	gform.addFilter('gform_chosen_options','set_chosen_options_js');
    	function set_chosen_options_js(options,element){
    		// disable search if select has less than 5 options
    		options.disable_search_threshold = 5 ;
    		// to disable search altogether use options.disable_search = true;
    	        return options;
    	}
    </script>
    <?php
    	return $form;
    }

    Find out more about gform_chosen_options and an example of how to limit the number of items which may be selected in a multi-select field on the following page of the documentation
    http://www.gravityhelp.com/documentation/page/Gform_chosen_options

    Regards,
    Richard
    --
    Just another member of the community helping out where I can

    Posted 11 years ago on Sunday April 28, 2013 | Permalink
  7. David Peralty

    Thanks as always richard. :)

    Posted 11 years ago on Monday April 29, 2013 | Permalink

This topic has been resolved and has been closed to new replies.