Skip Navigation

[Resolved] Select with Search

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by Minesh 6 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#1103683

Hello,

I am trying to add search option in the select option.
Like when you click on the country drop down, then you will see the search option and after that the list of countries.
I think i can able to explain my issue.
Can any one please help me?

Thanks,
Sukumar

#1104422

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - I would like to know here, you are displaying taxonomy as dropdown or custom field as dropdown select?

Additionally, you want to have implement chosen with your country select correct?
For example - something like this , correct? => hidden link

#1104440

Hello,

I am using taxonomy as dropdown.

Regards,
Sukumar

#1104458

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok - There is no native feature available but still you can try the following trick if that may help you:

Please try to add following code to your current theme's functions.php file and save it:

function enqueue_chosen_jquery() {
    wp_register_style( 'custom_chosencss', '<em><u>hidden link</u></em>', false, '1.1.0', 'all' );
    wp_register_script( 'custom_chosenjs', '<em><u>hidden link</u></em>', array( 'jquery' ), '1.1.0', true );
    wp_enqueue_style( 'custom_chosencss' );
    wp_enqueue_script( 'custom_chosenjs' );
    }
add_action( 'wp_enqueue_scripts', 'enqueue_chosen_jquery' );

Then - Edit your Form and add following code to JS editor:

jQuery(document).ready(function($){
 
  $(".wpt-form-select").chosen({
    no_results_text: "No Results Found!",
    max_selected_options: 5
   });
   
});
#1104491

Hello,

Your code worked perfectly. further I need a small favor from you.
The drop down select is not responsive now. How can i fix this issue.

Regards,
Sukumar

#1104492

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Sorry but that is beyond the scope of our support policy. As I update you before there is no such native feature exists but still I show you a way how you can achieve this.

You may check following link that may help you:
https://stackoverflow.com/questions/16960690/chosen-harvesthq-resize-width-dynamically