Skip Navigation

[Resolved] Add class to label when radio button is clicked

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by rainerS 5 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#1116283

Hi,

I would like to add a custom class (radio-toggle), when a radio button in my custom search is clicked.

I´ve tried it by myself with:
[code]
jQuery(function($){
$('.filter1 input.mask:checked').next('label.radios-taxonomies-title').addClass( "radio-toggle" );
});
[/code]

But it doesn´t work. I´ve inserted this javascript to the JS section at my view at Search and Pagination. Can you please help me solving this?

Regards,

#1117058

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Rainer,

Thank you for contacting us and I'll be happy to assist.

I tried to access your website (both front and admin area) and it seems there is an additional folder level protection enabled.

Can you please share login details to bypass that as well? It will allow us to troubleshoot why your script is not working.

( note: I have set the next reply to private which means only you and I will have access to it )

regards,
Waqar

#1117059
#1118158

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Rainer,

Thanks for writing back and for sharing the access details.

As much as we would like to help, I’m afraid, the support that we provide is limited to the code and built-in features covered in our plugins.

The custom script that you’re working with, will involve code specifically written for your website, which is beyond the scope of our support.

At this point I would suggest you to either ask this question at general jQuery forums or consider contacting one of our certified partners from this link:
hidden link

However, here are few links that may additionally help you:
=> https://stackoverflow.com/questions/17152494/jquery-addclass-to-label-if-radio-button-checked
=> hidden link
=> hidden link

If we can be of any further assistance, please let us know.

Regards,
Waqar

#1118175

This should work by default at toolset as it is nothing unusual to create a new class on a checked element.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.