Skip Navigation

[Resolved] Class ignored on radio input

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

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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by Nigel 7 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#524786

I am trying to set a class on a radio input in CRED, but it is ignored.
Is this standard behaviour?

[cred_field field='stripe-type' post='managed-account' value='' urlparam='' class='hidden']
#524787

And readonly='true' is ignored too ...

#524803

Nigel
Supporter

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

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

Hi Tina

The class parameter isn't available on the cred_field shortcode (https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field), so if you want to target the radio input for styling it will have to be as a child element of a wrapper element which you can target.

I tested the readonly parameter for radio inputs, and you are correct, it is being ignored.

I did wonder if that was by design on CRED forms to publish posts (where there is no prior value) but it fails on CRED edit forms, too.

As you probably know new versions of Toolset plugins, including CRED, are currently undergoing testing ahead of an expected release in the coming days, so I'm going to set up a test site with these development versions to see if the issue persists before escalating this thread.

I'll update you once I have done that.

#524834

Nigel
Supporter

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

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

Hi Tina

It doesn't work in the upcoming versions either, so I'm escalating this thread so that it can be investigated further.

As usual, I'll keep you posted when there is something to report.

#529784

Nigel
Supporter

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

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

Screen Shot 2017-05-29 at 13.26.08.png

Hi Tina

I'm reviewing the escalated threads now that the new releases are out.

Regarding readonly not being applied to the radio fields, the reason is that readonly only works with text fields.

If you try to manually add a text field to a CRED form you are presented with the additional options (such as readonly), as you can see in the screenshot, but adding other field types you are not presented with the same.

I've made a note to update our documentation to make that clear.

#531324

I understand. How about that class is ignored?

#531720

Nigel
Supporter

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

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

Hi Tina

Preparing the last release a number of inconsistencies were found in how the class attribute was being treated and these were reviewed and the documentation updated accordingly (https://toolset.com/documentation/user-guides/styling-cred-forms/).

That page includes a list of which fields can have custom classes added.

It's basically simple fields such as text inputs.

Complex fields such as radio inputs add not just an input field but an HTML structure around it, and it's not clear exactly where a custom class would be added.

You can always add a custom class on a container element and construct the CSS selector as required to target the specific element required (e.g. the label, the input field).