• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Issue with Conditional fIeld show

Issue with Conditional fIeld show 3 years 9 months ago #41404

  • miladox
  • miladox's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Hello, Please watch the video below and let me know what is the issue with the conditional field setting I made.

I want to show all the fields when the user picks the number from the dropdown list.
so when they choose 3 more it should show 3 more rows and when chose 4 more it should show all the 4 more.


www.loom.com/share/a0adcb0f7dbc41f9b7a38eb1994bf919

Please let me know
The administrator has disabled public write access.

Issue with Conditional fIeld show 3 years 9 months ago #41406

  • miladox
  • miladox's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Hello, Any updates? can you please let me know?
The administrator has disabled public write access.

Issue with Conditional fIeld show 3 years 9 months ago #41407

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 246
  • Thank you received: 64
I just set up similar in a test form with 3 fields as it looked like your conditions were a bit over-complicated and one condition would exclude another. I think that's the problem
If you set up the conditions like this it works as you would expect:

show field 1 if selection is any of1,2,or 3
show field 2 if selection is any of 2 or 3
show field 3 if selection is 3
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
Last Edit: 3 years 9 months ago by iceferret.
The administrator has disabled public write access.

Issue with Conditional fIeld show 3 years 9 months ago #41410

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You have conflicting conditions. Each field that you set to show/hide needs to have its own single separate condition and will be displayed or not if the given set choices are made.

Same for your other fields, they have to be kept separately. Basically specify all possible conditions a field should show/hide under a single conditional statement (you can of course set and include multiple fields at once if needed in the same condition, though don't repeat these in other conditions).

Let's assume you have a field that you want to show if certain conditions are made. Create a conditional statement for it, and specify all possible conditions that should show/hide that field. If you use this field once again in another separate condition to show/hide it, then this will create a conflict as each condition will be treated independently.

Start with your first field (or first set of fields), and set to show/hide according to your choice(s).

For example:

6 different fields: A, B, C, D, E, F.
A radio group representing the number of people: 1, 2, 3.
For each people there are 2 fields.

This would be setup as 3 conditions:

I. Field A & B set to "show" if "any" selection:
Radio is 1
Radio is 2
Radio is 3

II. Field C & D set to "show" if "any" selection:
Radio is 2
Radio is 3

III. Field E & F set to "show" if "any" selection:
Radio is 3

Notice how each field was kept in its own condition and wasn't repeated.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

Issue with Conditional fIeld show 3 years 4 months ago #41737

  • it.admin
  • it.admin's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I have a question concerning conditions, too.

I set up a form with a Birthday Yield. To show/hide some other fields, I need to know, if it is an adult or a minor. I use a JavaScript function to calculate that and an "onblur" event as attribute of the Birthday Field. For testing purposes I have created two more fields: "age_years" (contains the calculated age) and "is_minor" (contains true or false). Currently this fields are visible. It looks like, that I cannot use that fields in a condition. Is this this correct? How can I achieve that in another way?

Best regards
Thomas
The administrator has disabled public write access.

Issue with Conditional fIeld show 3 years 4 months ago #41739

  • it.admin
  • it.admin's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I replaced the text field with radiobuttons and I also tried checkboxes. I can use both of them in a condition now.

Next problem:
Within my Javascript function I calculate the age in years of the entered birthdate. I set the radio buttons or checkboxes in this way:
document.getElementById('is_minor0').checked = true;

But the condition does not work.
Show - block (label+field) "consent_publishing_personal_data_minors" if all of the following match:
is_minor is Yes

Only if I click the radiobutton/checkbox in the form with my mouse it works correctly.

Any hints welcome.


Thomas
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!