Skip Navigation

[Resolved] Adding Class to Radio Cred_Field does nothing (works fine everywhere else)

This thread is resolved. Here is a description of the problem and solution.

Problem:
I cannot add the class attribute to radio and other fields in forms.
What's the solution?

Solution:
You can set classes only to fields that render with simple HTML tags:
Native Toolset form fields:
post title field, input textfield for flat taxonomies.

Types and Generic fields:
Single Line, Multiple Line, Date (only the main input, the dropdowns for hours and minutes do not add it), Number, URL, Select, the parent selector field.

To suggest adding the class attribute to other fields such as radio please submit your voice for the feature at https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/ mentioning you would like to see support for the class attribute on radios and checboxes in Form fields

Relevant Documentation:
https://toolset.com/documentation/user-guides/styling-cred-forms/ and https://toolset.com/documentation/user-guides/styling-cred-forms/#toolset-forms-markup-overview

This support ticket is created 5 years, 6 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by shawnW-3 5 years, 6 months ago.

Assisted by: Beda.

Author
Posts
#1255371
inspect-ukcss.JPG
addedclasses-uikit.JPG

I am trying to: Add a class to a cred field.

Link to a page where the issue can be seen:
Currently private

I expected to see:
The CSS Style Rendered and/or the CSS Style Noted upon inspection.

Instead, I got:
Nothing.

The method for adding class to a Cred Field has so far worked for single line text inputs, text areas, and select fields, but when I add a class to the radio field, nothing shows up. The class doesn't publish anywhere using that very same method.

#1255497

I found one other cred field that doesn't accept classes...

[cred_field field='form_messages' class='uk-alert-warning uk-position-top-center']

Inspect shows:
class="wpt-top-form-error wpt-form-error wpt-form-error-wrapper alert alert-danger"

#1255581

You can set classes only to fields that render with simple HTML tags:
Native Toolset form fields:
post title field, input textfield for flat taxonomies.

Types and Generic fields:
Single Line, Multiple Line, Date (only the main input, the dropdowns for hours and minutes do not add it), Number, URL, Select, the parent selector field.

You can read more about this here:
https://toolset.com/documentation/user-guides/styling-cred-forms/ and https://toolset.com/documentation/user-guides/styling-cred-forms/#toolset-forms-markup-overview

The Document above will also help in styling other elements of the Form.

Please let me know if something remains unclear 🙂

#1257093
addedclasses-uikit.JPG

Thank you. I was able to style the radio's using your built in class names.

It does create some inconvenience as I have to rebuild classes I already have using the class names you've given. So, if it's possible for you to change that in the future, I'd like to make that a feature request ... add the class='classname' method to all cred field input types.

#1257103

My issue is resolved now. Thank you!