Skip Navigation

[Resolved] Unable to show dropdown in select with shortcode

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/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by himanshuS 2 years ago.

Assisted by: Luo Yang.

Author
Posts
#2505763

I want to show a dynamic dropdown with a generic select and shortcode combo.

I have followed the protocol suggested for generic field but still the fields don't show up. What am I mission?

Link to page: hidden link

Form setup - hidden link

#2505867

Hello,

In the screenshot you provided above, there is a custom shortcode [xyz-ics ...], how do you setup it?
You can follow our document to setup the outputs of your custom shortcode:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_generic_field
section "cred_generic_field", click link "Usage examples"

If you need more assistance for it, here is a test site:
hidden link
You can reproduce the same problem in above test site, I need to test and debug it in a live website, thanks

#2506091

Luo,
The output of the shortcode is visible on the page itself (hidden link) and it follows the format:
[
{"value":"user1","label":"User1"},
{"value":"user2","label":"User2"},
{"value":"user3","label":"User3"}
]

Output sample:
[{“value”:77179,”label”:”Hopper”},{“value”:77176,”label”:”Procter & Gamble”}]

I think the format is accurate. or is it?

#2506451

There are extra "[" and "]" characters in your custom shortcode outputs, please try to change the shortcode in your screenshot:
hidden link
line 21, as below:

"options":[xyz-ics ...]

And test again

#2506705

Thanks, Luo. I was able to make it work by inserting "" on the value field.

Now the output looks like this - hidden link

Is there a way to allow users to search for names in the select drop-down list? It's a long list and I don't want them to scroll down.

I tried to use the following recommendation from another thread but it did not work : https://toolset.com/forums/topic/select-with-search/

#2506967

There isn't such kind of built-in feature within Toolset Forms plugin generic field, you might consider custom codes, for example select 2:
hidden link

For your reference.

#2507331

My issue is resolved now. Thank you!