Site logo

Archived topic

Super forms script to toggle buttons off when one is on

1 reply · Started by Andrei on April 13, 2021

Viewing posts 1–2 of 2

Hi! I am working on a website using Generate Press and Super forms (https://ibsolutions.biz/piesarul is the site) .
The super form is used in a page called configurator to create a custom request for quotation form.
I got it to work up to the point where the user can toggle buttons and checkboxes show up based on whether the buttons are toggled on/off.
However, I want to make it so when a button is on the others are off. I tried my luck with this bit of code:


$(".super-toggle-switch").click(function(event){
$(this).addClass("super-active")
.siblings()
.removeClass("super-active");
}); 
 

It didn't work out. Any suggestions on how to improve it?
What currently happens is that when the toggle switch is turned on, it is assigned the class 'super active'.
Additionally, the button is toggled on, a subordinated div called super-shortcode-field is assigned the value "on" and when toggled off, it is assigned the value "off".

Basically, what I am hoping to achieve is that both the value of this class and the class assignment are triggered for one of the toggle buttons at a time.

I am aware this is not a 100% Generate press related topic, but I am hoping to find some clues here as well. This has been giving me headaches for a while.

Hi Andrei,

Unfortunately a question like this is definitely outside the scope of this forum.

I would recommend checking with Suprt Forms support team or posting on a general WordPress forum like this one:
https://wordpress.stackexchange.com/

Thanks for your understanding :)

This archived topic is closed to new replies.