Skip Navigation

[Closed] Color conditional in select field

This support ticket is created 8 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 - -
15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

This topic contains 1 reply, has 2 voices.

Last updated by Itamar 8 years ago.

Assisted by: Itamar.

Author
Posts
#381775

Hi, I tried looking for this solution but can't find it anywhere.

We have a 'select' field with three options: Cow, Sheep and Chicken.

We want to display a different color background depending on which option is selected.

Cow = Green, Sheep = Yellow and Chicken = Red

Is it possible to assign these colors to these selections and have the color display as a background depending on which one is selected?

So if we select Cow, the color green (using a pre-added: #00ff00 hexadecimal) displays as a background.

Assuming this is possible, would we add these conditional hexadecimals in the post field "set conditional(s)" section or in the content template - and if so, what would the conditional look like?

Thanks for any help.

#382146

Itamar
Supporter

Languages: English (English )

Timezone: Asia/Jerusalem (GMT+03:00)

Hello.

Welcome to the Toolset support forum.

Could you please elaborate a little more on this point so I can better understand?

where and how exactly you want to integrate conditional statement?
The color of what background do you want to change?
Is it the color of the field itself or any other background element in the page?

It may be that a JS solution will be more appropriate in this case, but for me to help you, please provide some more info about this case.

Sometimes screenshots illustrating what you mean may go a long way to clarify what words fail to transmit, so if you like, make use of “upload an image” below the comment area.

Please, could you provide me the additional Info?

Thanks,
Itamar.

The topic ‘[Closed] Color conditional in select field’ is closed to new replies.