Skip Navigation

[Resolved] Grouped radio fields

This support ticket is created 7 years, 1 month 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by stewartE 7 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#573253
radio.PNG

I have a scenario where I need to create a group of radio fields.

The user has to choose which shipping method they would like to use. They must choose either UPS, FED EX or International. So, in that case, I would just mark the radio field as required. Where it gets a bit more difficult is I need to have other options within the radio fields.

So for example, if the user picks UPS there are three more options (next day, 2 days, Early) but if they pick FED EX there are three more (different) options Prioirty, standard next day. They only need to pick either UPS, FED EX or International and the related options

So I guess the 3 fields (UPS, FED EX, International) need to be linked in some way? Otherwise, if I create 3 separate radio fields then each option would end up being required. Not sure if that makes sense??? I've uploaded a screenshot of what I am trying to do that might make it clearer

Thanks!

#573345

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Stewart,

Thank you for contacting our support .

Actually this is possible but it will need to be done using some css to display the radio options in line.

Take a look at the link below as it should allow you to see how this is achieved.
https://toolset.com/learn/create-an-ecommerce-wordpress-site/

Thanks,
Shane

#573582

Hi Shane, sorry not sure I understand. Which part of the page that you are linking to do I need to look at?

I will be able to work out how to make the radio buttons inline with CSS, Ignoring the layout, I was more looking for how to group them all together so that only one option is required.

1) A user must pick one of the options UPS, FEDEX or International. If they try to submit the form without picking from one of these three options they will get an error message.
2) If a user wanted to pick FEDEX as a shipping method they would need to pick between Priority, Standard or Next Day and they would not be required to check any options under UPS or International. If they wanted to pick UPS as a shipping method they would need to pick between Next Day, 2 Day or Early and they would not be required to check any options under FEDEx or International.

So I guess maybe i'm asking how to make something conditionally required??

Thanks!

#573794

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Stewart,

My Apologies, it seems that i've sent the wrong link .

The correct link should be
hidden link

However with the grouping that you require it wont be possible since you will need to create separate checkbox group. This means that you will need to write some custom code to lock the other options when a user selects an option.

I have an idea. Why not allow the user to first select their shipping method, e.g FEDEX then when the user selects fedex then display the shipping options for fedex instead of having all the options available from the start.

Please let me know.

Thanks,
Shane

#574047

That's brill - thanks Shane! I've implemented that and it does exactly what I was trying to do