Can't hide Empty and Required field

2 years 5 months ago - 2 years 5 months ago #326563 by galanopd
Hi,

The State/Province field is set to Required and conditionally shown according to Country field selection (empty/not empty)
The Parameters->Query work fine and if the Country selected has no State/Province, there is no value in it.
So far, so good.

The problem is that I need this field to remain Required in case there is a State and be hidden (required or no required seems irrelevant since it will be hidden) when empty (No State).
Configuration ->User Profile->Show Empty Fields is set to No but I don't also see a similar option in Configuration->Registration which is actually where I am facing the issue.
A conditional hide to the field itself does infinite loop and it is forced to a static condition to avoid Javascript errors (debug message).

Please Log in to join the conversation.

2 years 5 months ago #326570 by krileon
Replied by krileon on topic Can't hide Empty and Required field
You'll have to use CB Conditional for that. The below should be sufficient.

Display: Field conditional show
Field: Country
Operator: Not Empty

A conditional hide to the field itself does infinite loop and it is forced to a static condition to avoid Javascript errors (debug message).

I can't see any reason this would create an infinite loop unless State was conditioning itself. Please provide any JS errors you're seeing with the above condition.


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 to join the conversation.

2 years 5 months ago - 2 years 5 months ago #326613 by galanopd
Replied by galanopd on topic Can't hide Empty and Required field
I think you have missed the issue and that's probably my mistake.

State/Province is a required field

First case
Region->Northern America (Americas)
Country->United States
State/Province-->Connecticut

First case works fine and I can move to the next step as the required fields are filled.

Second case
Region->Polynesia (Oceania)
Country->Niue
State/Province--> No state

The second case doesn't allow me to go on as the field is required and it is not accepting empty

So the solution would be to hide when empty and show when non-empty, correct?

Concerning you answer "I can't see any reason this would create an infinite loop unless State was conditioning itself. Please provide any JS errors you're seeing with the above condition." on "A conditional hide to the field itself does infinite loop and it is forced to a static condition to avoid Javascript errors (debug message)." You are correct, my mistake, State was conditioning itself.

Please Log in to join the conversation.

2 years 5 months ago #326617 by krileon
Replied by krileon on topic Can't hide Empty and Required field

The second case doesn't allow me to go on as the field is required and it is not accepting empty

You can't select an empty value if the field is marked required. That's working as expected. Don't mark State required and that'll solve your issue.

So the solution would be to hide when empty and show when non-empty, correct?

No, a field can't condition itself. That would create an infinite loop. Don't mark State required as you're wanting to accept None thus the field is not actually required.


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 to join the conversation.

2 years 5 months ago #326619 by galanopd
Replied by galanopd on topic Can't hide Empty and Required field
But then the user will be able to leave the field empty even if there is a State and in my case it is very important to know the State the user lives.

Please Log in to join the conversation.

2 years 5 months ago #326626 by krileon
Replied by krileon on topic Can't hide Empty and Required field
Is your issue that the country selected has no states or provinces and is thus empty? That'd be a completely separate issue we'd need to try to address. Are you using CB Query Field for this chain of fields?


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.721 seconds

Facebook Twitter LinkedIn