Hi there,
I'm new into chronoforms V5 and I'm looking for a solution form my problem.
I made a multipage form. In the first page I would like the name of the logged in user to be automaticaly filled in.
How can I doe this ?
tnx for you answer.
Bart Weltens
I'm new into chronoforms V5 and I'm looking for a solution form my problem.
I made a multipage form. In the first page I would like the name of the logged in user to be automaticaly filled in.
How can I doe this ?
tnx for you answer.
Bart Weltens
Thank you Bob,
I already tried it, but it seem not to work.
I'm not sure where (and how) to put the code into the form.
Can you give me some advice ?
tnx for you answer.
Bart
I already tried it, but it seem not to work.
I'm not sure where (and how) to put the code into the form.
Can you give me some advice ?
tnx for you answer.
Bart
Hi Bart,
I think you need to add it pretty much as it says in the FAQ. What have you tried?
Bob
I think you need to add it pretty much as it says in the FAQ. What have you tried?
Bob
First I added follow code into the “setup”tab into the “on load” event just before the HTML(Render Form)-action.
Then I’m not sure what the next step is as I do not know what to do with “So, if you want to load information about a user from a database table you can use a Custom Code action to put the User ID in the $form->data array and then use that as the 'token' in a DB Record Loader action. In this case you'd use user_id in the Token box:” from the FAQ-step :?
<?php
$user =& JFactory::getUser();
$form->data['naam'] = $user->name;
?>
Then I’m not sure what the next step is as I do not know what to do with “So, if you want to load information about a user from a database table you can use a Custom Code action to put the User ID in the $form->data array and then use that as the 'token' in a DB Record Loader action. In this case you'd use user_id in the Token box:” from the FAQ-step :?
Hi Bart,
That should give you the name of the current user. Does it?
You only need the DB part if you want to import data from some other table.
Bob
That should give you the name of the current user. Does it?
You only need the DB part if you want to import data from some other table.
Bob
Hi Bob,
No it does not.
I get :
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING in /var/www/vhosts/kbha.be/httpdocs/administrator/components/com_chronoforms5/chronoforms/actions/custom_code/custom_code.php(20) : eval()'d code on line 3
When I go back to the setup tab and open the custom code , it has changed itself to
<?php
$user =& JFactory::getUser();
$form->data[\'naam\'] = $user->name;
?>
(note the \ before and after 'name')
No it does not.
I get :
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING in /var/www/vhosts/kbha.be/httpdocs/administrator/components/com_chronoforms5/chronoforms/actions/custom_code/custom_code.php(20) : eval()'d code on line 3
When I go back to the setup tab and open the custom code , it has changed itself to
<?php
$user =& JFactory::getUser();
$form->data[\'naam\'] = $user->name;
?>
(note the \ before and after 'name')
HI Bart,
If this is in a Custom Code action (you don't say) then probably your site has Magic Quotes set to on, please try setting them off. You can check the setting on the PHP Info tab in the System Info.
Bob
If this is in a Custom Code action (you don't say) then probably your site has Magic Quotes set to on, please try setting them off. You can check the setting on the PHP Info tab in the System Info.
Bob
This topic is locked and no more replies can be posted.