Forums

DB Record Loader ist not working

Funkyflipper 14 Feb, 2013
Hi,
on our website we have a members area with a form for user profile data. For this form we use the latest chronoform-version. When a user submit this form the data will be stored in a chronoforms-table in the database. This works without a problem. But if a user opens the form again it's not possible to load the data from the database with the DB Record Loader. I followed exactly the tutorial in the faq-section.

DB Record Loader before HTML in the 'on load section'.
DB Field: cf_created_by
Table: k4v38_chronoforms_data_Freelancer_Profil
Request param: profile_id

PHP-Code (Custom Code Element) befor the DB Record Loader:

<?php
$user =& JFactory::getUser();
$form->data['cf_created_by'] = $user->id;
echo $form->data['cf_created_by']; // here I get the right user-id
?>


The Form-URL show no data:
index.php?option=com_chronoforms&chronoform=Freelancer-Profil&profil_id=399

The form is loaded via an joomla-modul in a standard Joomla Article.

I'm absolutely not shure where my fault is? Any ideas?
Thanks and regards!
funkyflipper
Funkyflipper 14 Feb, 2013
The DB Record Loader works now! I made a mistake on the form name.
But i have a "last" question: the profil-form is accessable via an submenue-link in the mainnavigation. Only visible for members. If someone click on this link i must add the required information to the url ....&profile_id=$user_id to load the correct formdata for this user.

The data I need:
$user =& JFactory::getUser();
$user->id;

But how can I add this information to the URL in the Joomla-Menu?

Remind that the form is loaded with a joomla-modul in a article.

Thanks!
GreyHead 15 Feb, 2013
Hi Funkyflipper,

You can't add it to the menu link because it will be different for each user. You can set it in the form On Load event though.

Please see this FAQ

Bob

PS Why would you load a form with a Joomla! Module in an article? Just curious.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger