show/hide elements in a form based on a "config-field" from another table

wuschel_lux

Member
Hi,

I am trying to have a form with each time different elements shown/hidden based on checkboxes set in an other table.

Table A contains:
ID | EVENT NAME (field) | REQUIRED_FIELDS (checkbox)
e.g.
13 | Test Event | ["A","C"]

Form B based on Table B
ID | EVENT (databasejoin) | FIELD A | FIELD B | FIELD C | FIELD D
e.g.
7 | 13 | Field A (show) | Field C (show)

How can I manage, when selecting in the Form B the EVENT, that fields are shown/hidden based on the Table A REQUIRED_FIELDS? With JavaScript I could manage to show hide on some criteria, but how ca I access the external table to get the values?
First try was with a calc field where I get the return ["A","C"], but I cannot trigger on this calc field JavaScript.

Has somebody a hint for me?
BR
 
You can pull the required_fields with a CDD or a 2nd dbjoin watching the first one and add hide/show JS to this element.
 
thanks a lot for the hints!
I tried with "hidden" cascadingdropdown and it works fine for me.

Only thing i do not understand: when using on "change" trigger and "contains" / "does not contain" in inverse oder it does never show something.

e.g.: this order works at it should
on change : When this element "fields" does not contain "001_first_name", hide element "inscription_event.first_name"
on change : When this element "fields" contains "001_first_name", show element "inscription_event.first_name"

but this one never...
on change : When this element "fields" contains "001_first_name", show element "inscription_event.first_name"
on change : When this element "fields" does not contain "001_first_name", hide element "inscription_event.first_name"
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top