Display element dinamic update [SOLVED]

Puma173

New Member
Good morning everyone.

First of all, I have to thank the authors of these great extensions and the community members for all the work done.

I have a question.
I have a form to collect the visits to my plant.
One or more policies (security, data, ...) are applicable for all the visitors of the plant.
Policies and Plants have a relation table (N-M).
On the "visits" form I insert two fields:
  1. "plant_id" (database join with the "plants" table)
  2. "policies" (display element)
I need to display the plant-related policy/ies (id or title) in the "policies" element. The policies change based on the plant selection.
I tried to do this with a PHP plugin but I'm in trouble.
 
Use calc element for policies and in the calc element settings use "plant" dbjoin element as "ajax observe field". So the policy will update when plant is selected.

Or you can have another field in plants table where you add the policy. And then use that field as "comment" field in dbjoin element settings.
 
Tks a lot for your reply.
I followed your suggestion but I'm having some issues.
Where am I wrong?
I'm a newbie...sorry for my poor knowledge.
 

Attachments

  • 1.png
    1.png
    52.9 KB · Views: 114
  • 2.png
    2.png
    56.4 KB · Views: 122
Not sure, but try to replace $plantId = '{visits___plant_id}; with $plantId = '{visits___plant_id_raw};

Do you get expected results to your query in phpMyAdmin if you replace '$plantId' with some existing fixed value?
 
Not sure, but try to replace $plantId = '{visits___plant_id}; with $plantId = '{visits___plant_id_raw};

Do you get expected results to your query in phpMyAdmin if you replace '$plantId' with some existing fixed value?
First of all, thanks a lot for your collaboration. The calc element was the right suggestion. The issues were to the use of a deprecated db connection (I'm using 7.3 PHP version). So it's necessary to adopt these PHP references: http://fabrikar.com/forums/index.php?wiki/calculation-element/
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top