[Waiting for user confirmation] Restrict user to select one category only

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.

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Related documentation: Front-end Content Submission and Editing Forms

This topic contains 25 replies, has 2 voices, and was last updated by  Christian Cox 11 minutes ago. The support staff assigned to this topic is Christian Cox.

Viewing 11 posts - 16 through 26 (of 26 total)
Author
Posts
#549787

Thanks for that Christian.

OK, I must apologise but my age is obviously catching up with me and I cannot think or understand like I used to!

I have been over and over the link that you give above but simply cannot understand it! 🙁

In the bit about filtering by taxonomy it gives an image. But when I click on 'add a filter' I don't get that image and cannot make any sense of what I should be doing.

#549928

Christian Cox
Forum moderator

Supporter languages: English (English )

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

Instead of clicking "Add New Filter" in the Filter Controls editor, scroll up to the Query Filter section and add the filter here. If you do not see a Query Filter section, scroll all the way up to the top of the screen and click "Screen Options". You'll be able to enable the Query Filter section there. Let me know how it goes.

#549952

I have never used the Filter Editor but always used Query Filter.

When I click Add a Filter at the Query Filter section I do not get a pop up box that looks anything like that in the link you gave.

The View I created was Taxonomy > MyCustomTaxonomy

I tried changing the view to Post types > MyCustomPostType This gives me a choice that looks a bit more like the image in the link, however, it still doesn't allow me to carry on

#550078

Christian Cox
Forum moderator

Supporter languages: English (English )

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

Ok let me jump in and make some adjustments, I'll update you shortly.

#550084

Christian Cox
Forum moderator

Supporter languages: English (English )

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

Please take a look here now:
/add-breed-notes/

Do the select fields show the appropriate options now? I have created a select field for each top-level term in the Breed Notes taxonomy. The terms for each select field are the child terms of that parent term.

So now, you have the ability to select subcategories from the different main categories. Are we heading in the right direction?

Note: - I edited functions.php so you may need to download it and integrate the changes in your local source code.

#550344

OMG! You are amazing!!!!

thank you thank you thank you! I can't thank you enough!!! Now going to scrutinise how it works LOL!

#550345

Christian Cox
Forum moderator

Supporter languages: English (English )

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

Hi, I'm reopening this ticket because we aren't finished yet - the selections in these fields are not saved with the post. There's still a bit of work left to do on that. I just wanted your feedback on whether the options are accurate.

#550407

LOL!!! Thank you Christian!

Yes - they are perfect!

#550482

Christian Cox
Forum moderator

Supporter languages: English (English )

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

Ok next questions:
• Is at least one subgroup selection required?
• What happens if a user selects more than one subgroup? For example, there's nothing to stop a user from selecting Clumber Spaniel and Basenji, from two different main groups. The options are:
- Allow the user to select more than one subgroup, and save both selections
- Show the user a validation error after they submit the form and require them to select only one subgroup before the post is saved
- Refactor this to use a radio button group (only one option can be selected) instead of multiple single select fields

#550612

1) Yes, they MUST select one subgroup

2) As submission will only ever be relevant to just one subgroup the last option of radio button would be best.

#550910

Christian Cox
Forum moderator

Supporter languages: English (English )

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

Okay I've made the necessary modifications:
- Edited functions.php to remove view 309 from the array of raw text Views
- Added cred_save_data function to functions.php
- Edited your CRED form. You should not use the class "cred-form" in your markup because it conflicts with some code that is required by CRED. I have modified it to be 'cred-form-div-wrapper' instead:

<div class="cred-form-div-wrapper">

- Modified View "Select breed from groups" to place the nested View directly here instead of using a generic field. I found out that it's not possible to split up a generic radio group into multiple Views, so this is the best solution.
- Modified View "Select breed from subgroups" to use basic HTML inputs instead of a generic field, and added some JS code to fix an issue with the labels. I also modified the CSS to add some left padding to each row of inputs.

Please test the Add Breed Note form and let me know if it saves the breed taxonomy term appropriately. Remember to download functions.php updates for your own local copies.

Viewing 11 posts - 16 through 26 (of 26 total)

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Known issues and their solutions

We document known issues and their solutions in Toolset erratas. Save time by checking there first and seeing if what you are facing is a known issue. This list is kept short. We do our best to resolve all known issues with every release of Toolset plugins.

Support Policy

Toolset staff will help you use the Toolset plugins correctly, provide any information you need, help troubleshoot problems and advice on best-practices.

Please make sure to issue only one topic per each support ticket.

For more information, read our full Customer Support Policy.

Need custom programming work for your site? Check out our certified partners.