Send data betwen differents forms, and conditioning the value of the element..

cabetza1

New Member
...to the value of the first form, example; I have relation (one to many) form1 and form2 this has an element with "database join" to an element of the form1 (the id), I want to fill form1, and when I press submit, This open the form2 conditioning element who has "database join" to the value of the id element from form1.
 
You should be able to do this with a 'redirect' plugin on the first form. Set the URL to point to the second form, using a {placeholder} for the rowid value ...

index.php?option=com_fabrik&view=form&fabrik=X&rowid={firsttablename___dropdownname}

Obviously replace firsttablename___dropdownname with the correct names, and X with the second form's numeric ID.

-- hugh
 
Ok thanks this works Ok when i already have a form2 with a element from form1, but when i want to add new elements to the form2, i just want that the form2 get opening with the default option selected comming from the element from the form1. example: I have from form1 fabrik_internal_id = 1 then when submit open the form2 with the default value dropdown element = 1 (same as the form1) so they be related (one-to-many)
 
OK, so add something like ...

&table2___form1_id={table1___fabrik_internal_id}

... which should prefill an element called form1_id on table2 with the PK value from form1.

If {tabel1___fabrik_internal_id} doesn't work, try ={rowid}, or even ={__pk_val}

If you aren't using the default fabrik_internal_id on your table1, use whatever element name is defined as the PK for that table.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top