Skip Navigation

[Resolved] Styling a Multiple Select Box – Classname not being added

This support ticket is created 7 years, 7 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
- 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 3 replies, has 3 voices.

Last updated by leeF-2 7 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#511892
snag.jpg

I have created a CRED Post Add form. In the form I have a category field set to "select". I've added to that field "class='categorySelect'. In the CSS section of the form I added some CSS to style ".categorySelect". However, after updating the form and previewing, the style name is not applied to that field.

Am I missing something?

Thanks.

#511965

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Lee

The cred_field shortcode doesn't have the class attribute (https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field), which is why it's not working.

You can either wrap your shortcode in a div and add the class to that to be able to target your select box, or use your browser dev tools to inspect the generated select box on the front end and identify an alternate CSS selector to target the select box directly.

For standard categories, something like this should work:

select[name*="category"] {
  color: red;
}
#511967

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

As you can see with our Docs - [cred_field] shortcode do not offer class attribute:
=> https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field

You may try to use jQuery and use addClass method to add class to your element.
=> hidden link

#512159

Ah.. I misread the documentation.

Thanks that solved it!