Skip Navigation

[Resolved] Select2 don't load any results

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Waqar 1 year, 2 months ago.

Assisted by: Waqar.

Author
Posts
#2650073
Captura de pantalla 2023-10-04 a las 11.42.30.jpg

Hello. I have a problem.

I have a dropdown that loads results of addresses of custom post type. If I aply select2 to that dropdown it shows no results.

I applied select2 following this instructions: https://toolset.com/forums/topic/make-the-toolset-form-generic-field-be-searchable/

The dropdown is located in custom search in archive.

#2650295

Hi,

Thank you for contacting us and I'd be happy to assist.

Do you see any error or warning, in the browser's console or in the server's error log?
( ref: https://wordpress.org/documentation/article/debugging-in-wordpress/ )

If there are none, you're welcome to share temporary admin login details and the exact steps to see the issue.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

regards,
Waqar

#2650355

Thank you for sharing the access details.

I've changed the custom script part from:


jQuery(document).ready(function() {
    jQuery('.desplegabledir').select2();
});

To:


jQuery(document).ready(function() {
	jQuery('#desplegabledir select').select2();
});

After this change, the select2 script is working.

#2651461

Hello Waqar. Thanks a lot for your help!!!!