Skip to Content Skip to Menu

[SOLVED] Field group conditional

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
2 years 8 months ago - 2 years 8 months ago #328313 by galanopd
[SOLVED] Field group conditional was created by galanopd
I am trying to show/hide conditionally a field group e.g. cb_education during registration proccess.
I have changed all fields to be visible in registration.

Let's suppose that I have a select field during registraion named "R U a Student" with 2 options e.g. Option1:Student, Option2:Not a student

Now, whatever the CBConditional settings are, I can't make cb_education fields hide and they remain always visible.

For instance I tried
- Field conditional Show based on "R U a Student" equal to "Student" but it is visible even when "R U a Student"=Option2
- Field conditional hide based on "is not RegEx" "/student/" the same here

I believe I have tried almost everything and I have applied the above rules to all fields within the field group (logo, description dates, etc) but no luck so far
Last edit: 2 years 8 months ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
2 years 8 months ago #328318 by krileon
Replied by krileon on topic Field group conditional
Client side conditions are entirely JS based. If your site is throwing JS errors then the JS in CB Conditional will fail and it can't show/hide anything. My guess is you've JS errors being thrown on your site. Alternative is your condition is wrong or not being applied to registration.

First step is to see if your site is throwing errors. Press F12 to open your browsers developer tools and click the Console tab. Now refresh your registration page and see if there's any errors. Errors will be messages in red.

If there are no errors be sure CB Conditional is public and published in CB > Plugin Management so it can function during registration fine. If it is edit your condition and ensure in "On" of your condition you have Registration selected.

I've confirmed just now conditions against field group fields appear working fine still so issue likely localized to your site due to 1 of the above possible problems.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
2 years 8 months ago #328358 by galanopd
Replied by galanopd on topic Field group conditional

First step is to see if your site is throwing errors. Press F12 to open your browsers developer tools and click the Console tab. Now refresh your registration page and see if there's any errors. Errors will be messages in red.

I had checked that and I had no errors but only warnings that I am not sure if they are related to this. The truth is that I had CB jquery turned off cause I wanted to check something and then I forgot to turn it back on. So I turned it on but the issue remains.

If there are no errors be sure CB Conditional is public and published in CB > Plugin Management so it can function during registration fine. If it is edit your condition and ensure in "On" of your condition you have Registration selected.

Checked that and it is public. Checked condition also. I have used conditions many times and I believe the settings are ok but I can't be 100% sure though.

One thing I noticed is that it was loading both migrate 1.4.1 from Joomla and 3.3.2 from CB.
I turned off CB's jquery to check for possible errors from 1.12.4 with 1.1.4 but I saw only warnings.
Even when turning CB's jquery and migrate on and disabling Joomla's 1.4.1, I see only warnings.
What version of jquery is CB using 2.2.4 or 3.5.1 ?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
2 years 8 months ago #328362 by krileon
Replied by krileon on topic Field group conditional
CB is using jQuery v3.5.1. You do not need to turn on jQuery Migrate. Please PM backend super user login credentials and include details about what field is causing problems and will take a look.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: galanopd

Please Log in or Create an account to join the conversation.

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
2 years 8 months ago - 2 years 8 months ago #328375 by galanopd
Replied by galanopd on topic Field group conditional
Before you login as I want to be precise with my description, please check the following:
I have managed to spot the issue and it is more complicated than what I had initially described as I didn't take all parameters into account.
Here follows a more detailed description of the issue in case you have faced something similar before.
If my description is not sufficient, then I am afraid you will have to log in.

IN REGISTRATION

Tab1 has 1 field:
-> "R U a Student?" (Option1:Yes, Option2:No, Option3:Maybe)

Tab2 has 2 group fields:
-> cb_education (field group)
--> Condition for Field group cb_education -> Show when "R U a Student? = Yes" (Tab2 should show up with only cb_education)

-> cb_work (field group)
--> Condition for Field group cb_work -> Show when "R U a Student? = No" (Tab2 should show up with only cb_work)

Condition for Tab2
-> Hide (Tab2) when "R U a Student?" is not REGEX "/Yes|No/"
(In other words Show Tab2 if it is Yes and No and hide when it is Maybe, Applies only to Registration as only registration button is clicked in conditional. I choose Hide condition as I don't want Tab2 to be hidden in profile, etc.)

Now, if I take out the condition from Tab2 then everything works fine. That means that the field group conditions are correct and show/hide properly in the always visible Tab2 since the latter has no condition.

Conclusion is that the Hide condition for Tab2 causes all the mess and I have tried almost everything to make it work with no success so far.

To recap, the request is as follows:

Show Tab2 when option Yes (will include only cb_education)
Show Tab2 when option No (will include only cb_work)
Hide Tab2 when option Maybe

I hope that my description makes sense...


EDIT: It is finally solved by deleting all settings, clearing cache and starting all over... Thank you.
Last edit: 2 years 8 months ago by galanopd.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
2 years 8 months ago #328378 by krileon
Replied by krileon on topic Field group conditional

EDIT: It is finally solved by deleting all settings, clearing cache and starting all over... Thank you.

Deleting all settings? You mean removing the condition then re-adding it fixed your issue?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum