In the setup I placed Custom Code in the load Event to get user name who logged in at Joomla with following code
I see on the form when executed that $user is known by testing with the echo command.
In the form I have a dropdown that is filled with data from a database. In the field Option I filled in
I like now to preselect the name from the user that is logged in, and known by $user->name.
There for I'm looking for a few days but can't find the solution for this.
Can anyone help me with this ?
<?php
$user = JFactory::getUser();
echo $user;
?>
I see on the form when executed that $user is known by testing with the echo command.
In the form I have a dropdown that is filled with data from a database. In the field Option I filled in
{var:read_data4}
. This is the name from the Read Data action in the load event. When executing the form I see al the names coming from the database. So far so good.
I like now to preselect the name from the user that is logged in, and known by $user->name.
There for I'm looking for a few days but can't find the solution for this.
Can anyone help me with this ?
Hi Verreyt,
In v6 you can do this by adding the following code to the "Selected values" box in the dropdown settings:
No php is needed.
Best regards,
Max
In v6 you can do this by adding the following code to the "Selected values" box in the dropdown settings:
{user:name}
No php is needed.
Best regards,
Max
This topic is locked and no more replies can be posted.