Skip Navigation

[Resolved] Default label for dropdown with custom values not working

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
- 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 2 replies, has 2 voices.

Last updated by adrianM-6 6 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1075006
2018-08-06 17_24_41-Window.png

Similar to other fields I want a default label which shows the fields purpose.

My field is defined like:

[wpv-control-postmeta field="estate_property_bedrooms" type="select" source="custom" default_label="Min. bedrooms" url_param="wpv-estate_property_bedrooms" values="2,3,4,5,6,7,8,9,10," display_values="2,3,4,5,6,7,8,9,10,"]

Problem: In the frontend it just shows "Select an option" instead fof "Min. bedrooms".

#1076028
default_label.JPG

Hello,

I have tried your codes, it works fine in my localhost, it does display "Min. bedrooms" as the default option, see screenshot: default_label.JPG

In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2017, and test again

#1076093

Hello Luo,

Thank you.

The problem is somehow related to the Chosen library, which doesn't respect the correct values there.

Thanks,

Adrian

----

Edit: Ah,

I found another issue for the manual dropdown. I had an empty value after the last value, with empty label.

Wrong:

[wpv-control-postmeta field="estate_property_bedrooms" type="select"  source="custom" placeholder="Min. bedrooms" default_label="Min. bedrooms" url_param="wpv-estate_property_bedrooms" values="2,3,4,5,6,7,8,9,10," display_values="2,3,4,5,6,7,8,9,10,"]

Correct:

 [wpv-control-postmeta field="estate_property_bedrooms" type="select"  source="custom" placeholder="Min. bedrooms" default_label="Min. bedrooms" url_param="wpv-estate_property_bedrooms" values="2,3,4,5,6,7,8,9,10" display_values="2,3,4,5,6,7,8,9,10"]