How to link forms in fabrik

mastro112

New Member
Hello All,
I'm new with Fabrik. I want to link some forms in Fabrik.
I have a user form and a organisation form and when a user loggs in i want to display their info in a customers form
I have tried a lot of things with {$my->email} I don't understand PHP i there something else i can try so that i get that info in a customersform ??
 
I'm not sure what you mean by "when a user loggs in i want to display their info in a customers form".

Do you mean you want to default some elements on a form to values from their Joomla user settings? So when they create a new form, things like "email" are already filled in?

-- hugh
 
Yes indeed,
I have a list and forms and groups, and i like to show some element like Adress, telephone e.o. in a new form.
For example i have a company list with adress and all, and they have a user login. So when they login and go to the form of new gig they don't need to fill in their adress and telephone again. so this must be already filled in.
I don't understand php.
Sorry for my english is not very good :)
 
OK, there's several ways to do that.

One way is to do database lookups in the defaults for fields you want to pre-fill. So say your 'company' table has a field called 'userid', and a field called 'phone', and you want to get the company telephone for the logged on user filling out the 'gig' form (coresponding to the userid in the company table). In the email field on the gig form, put this in the default:

Code:
$myUser = JFactory::getUser();
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery->select('phone')->from('company')->where('userid = ' . $myUser->get('id'));
$myDb->setQuery($myQuery);
return $myDb->loadResult();

... and set "Eval" to Yes.

For any other fields you want, just copy the code, and change 'phone' to the field you need ('email', 'address_line_1', whatever).

-- hugh
 
I have done that but my fields are still blank.
My form where i need to extract my data from is "ed_klantfactgegevens" and my adress from there is "adres_bedrijf"
I have in both a field with userid
 

Attachments

  • Fabrik1.jpg
    Fabrik1.jpg
    36.8 KB · Views: 19
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top