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
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
Hi Bart,
I think you need to add it pretty much as it says in the FAQ. What have you tried?
Bob
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
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')
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
Hi Bob,
Thank very much.
The Magic_quotes thing did the trick.
Bart