I have a table in my database called "gra_acct_info". This table contains a field named 'acct_user_id', which matches the 'id' field in the Joomla "users" table.
How can I create a form that will open, pulling in the data from "gra_acct_info" for the currently logged-in user?
I have tried to follow along with the PDF "How to load one row from a DB into your form", but I admit that I am missing something!!
Thanks!
Rick
How can I create a form that will open, pulling in the data from "gra_acct_info" for the currently logged-in user?
I have tried to follow along with the PDF "How to load one row from a DB into your form", but I admit that I am missing something!!
Thanks!
Rick
Hi Rickm
What do you have in the DB Record Loader settings now? And what do you see if you add a Debugger action to the On Load event.
Bob
What do you have in the DB Record Loader settings now? And what do you see if you add a Debugger action to the On Load event.
Bob
I have the following--
DB Field: acct_user_id
Table: an8ke_gra_acct_info
Load Fields: Yes
Curly Replacer: Yes
Load Under Model ID: No
Where Statement:
With a debugger action, I see this:
Interestingly enough, that is the correct information. I create most of my forms using the Easy Form Wizard. This one, due to my needs, I am building under the regular Form Wizard. I am trying another form under the Form Wizard as well (without an OnLoad action) and neither one will display on the front end of the site.
DB Field: acct_user_id
Table: an8ke_gra_acct_info
Load Fields: Yes
Curly Replacer: Yes
Load Under Model ID: No
Where Statement:
<?php
$user =& JFactory::getUser();
echo "`acct_user_id` = '{$user->id}'";
?>
With a debugger action, I see this:
Data Array:
Array
(
[option] => com_chronoforms
[chronoform] => edit_acct_info
[Itemid] =>
[acct_id] => 36
[acct_user_id] => 47
[acct_name] => ABC Heating and Cooling
[acct_address] => 105 Main Street
[acct_city] => Cleveland
[acct_state_short] => OH
[acct_zip] => 96841
[acct_phone] => 800-555-1212
[acct_fax] => 800-555-4819
[acct_principal] => Sam Asher
[acct_quota_purch] => 85000.00
[acct_quota_points] => 2500
[acct_todate_purch] => 42025.00
[acct_todate_points] => 1131
[acct_last_update] => 02/01/2012
)
Debug Data
db_record_loader
SELECT * FROM `an8ke_gra_acct_info` AS `An8keGraAcctInfo` WHERE `acct_user_id` = '47'
Interestingly enough, that is the correct information. I create most of my forms using the Easy Form Wizard. This one, due to my needs, I am building under the regular Form Wizard. I am trying another form under the Form Wizard as well (without an OnLoad action) and neither one will display on the front end of the site.
If it helps, here are links to three forms on the site--
This form, created under Easy Form Wizard, does display:
http://www.thegragrouptrips.com/tripdemo/registration
These forms, created under Form Wizard, do not (debug info included on both, and both are published):
http://www.thegragrouptrips.com/tripdemo/index.php?option=com_chronoforms&chronoform=trip_registration
http://www.thegragrouptrips.com/tripdemo/index.php?option=com_chronoforms&chronoform=edit_acct_info
This form, created under Easy Form Wizard, does display:
http://www.thegragrouptrips.com/tripdemo/registration
These forms, created under Form Wizard, do not (debug info included on both, and both are published):
http://www.thegragrouptrips.com/tripdemo/index.php?option=com_chronoforms&chronoform=trip_registration
http://www.thegragrouptrips.com/tripdemo/index.php?option=com_chronoforms&chronoform=edit_acct_info
Hi Rick,
You probably need to drag a Show HTML action into the On Load event of your form. Please see the video 'A First Form' at http://youtube.com/greyheadnet
Bob
You probably need to drag a Show HTML action into the On Load event of your form. Please see the video 'A First Form' at http://youtube.com/greyheadnet
Bob
This topic is locked and no more replies can be posted.