Skip Navigation

[Resolved] Echo [title] from [value] option select field

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 1 reply, has 1 voice.

Last updated by quentinN 2 months, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2783738
Capture d’écran 2024-11-14 à 15.51.14.png

Hello,
I would like to display the Title of an option in a select field rather than its value, which is just a slug.
How can I do this?
Best regards,
Quentin NORMAND

#2783933

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

What if you try to use the Types PHP API function types_render_field() in order to display the select box selected option text.
- https://toolset.com/documentation/customizing-sites-using-php/functions/#select

For example:

$selected_option_text = types_render_field("type-viager", array());
echo $selected_option_text;
#2783979

It's work, thanks!