On my listing create or update form, I have a radio button called “radio1” with two options let 's say: “option1” and “option2”. Depending on the option selected in “radio1” I would like to show/hide checkBox1 or checkBox2.
That means:
if “option1” is selected, show “checkBox1” and hide “checkBox2”.
if “option2” is selected, show “checkBox2” and hide “checkBox1”.
Can you please help with the code snipped for this?
If you mean to dynamically hide dependencies on selection, then there is no simple PHP snippet, it will require advanced customization. If you are familiar with coding or have a developer, we can provide general guidance.
Thanks Andrii, I understand what to do but the problem is that the html fields don’t have an ids, so it is hard to target anything. For example see below what the html code looks like. I would like to hide one of the checkboxes depending on the value of the selected radio button. How do I target the correct div containing the checkboxes? Any help will be appreciated.