Read fields from databasejoin

nerio

Member
In a form I have a databasejoin element that I would like to display some fields of the linked table in variables within the form. How can I do?
 
What do you mean with "some fields ... in variables within the form"?

You can use
  • "or concat label" to display multiple columns in the dbjoin field
  • the autofill form plugin to fill additional fields on select
  • additional dbjoin elements (condition with ajax update) or CDD elements
  • php code in a custom template...
 
Thanks Troester. The concatenated label might work too but it reads the value to me, not the label. Let me explain: if in the linked table I have a 'type' field which is a dropdown where 1 = Camping, 2 = Hotel, etc. I read 1 and 2, not Camping and Hotel. The best solution for me would be to read the labels from the linked table and write them in the form (in separate fields or in a single field with concatenated labels).
 
Sorry but maybe I didn't make myself clear.
I need to retrieve the label value of a field that's in the table, not a field from an external table.
For accuracy: from field B1 of table B I have to read the label of dropdown field A1 of table A.
 
This is complicated, you would have to examine the element parameters for getting the fixed labels or even the evaled ones (as it is done in the dropdown code).
 
I solved it this way.
I created a field with code = label and I concatenated the fields.
Thanks.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top