Skip Navigation

[Resolved] Restrict user to select one category only

This support ticket is created 6 years, 9 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 33 replies, has 2 voices.

Last updated by Christian Cox 6 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#551996

Also, if I were to look at bootstrap, do I need to install anything, or is it already installed?

#552079

It was perfect when you did the drop down boxes - is it possible for me to do that instead of radio buttons?
If you implement several select fields as I did before, the main problem is there is no front-end validation that will limit your users to select only one option. You would have to add some custom validation on the back-end using PHP and the CRED API:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
This is why I recommended a series of radio buttons instead of select fields - a radio button group can be split apart into several Views with section headers to group them together. A select field cannot be split apart like this.

Also, if I were to look at bootstrap, do I need to install anything, or is it already installed?
There is a setting in Toolset > Settings > General that will instruct Toolset to load Bootstrap. If you enable this setting, there is nothing else needed to install Bootstrap. You can begin using its CSS and JS components right away. If your theme loads Bootstrap on its own, you should instruct Toolset not to load Bootstrap.

#552371

Thanks.

I'd like to do an accordion effect using css, so need to add a class to the group name (ie Gundog Group), and then a different class to wrap around it's sub-categories - is there a way that can be done? I have looked at the view 'Select Breed from SubGroups', but can't see how it can be done.

#552627

You can wrap any HTML you want around the wpv-taxonomy-title tag in the Select Breed from Groups View. So you can wrap the Group name like this:

<div class="whatever-class-name">[wpv-taxonomy-title]</div>

Then in the Select Breed from SubGroups View, you can add classes to the existing span surrounding each row:

<span class="select-breed-subgroup-row whatever-class-name">

Or you could wrap a div around the existing span and apply a class to that div.

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