Can I populate the user data like name and Email to my form?
According to the Joomla! API, you can query the user's data with this PHP code:
//Name: <?php $user = JFactory::getUser(); return "$user->name"; ?> //Username: <?php $user = JFactory::getUser(); return $user->username; ?> //User id: <?php $user = JFactory::getUser(); return "$user->id"; ?> //Email: <?php $user = JFactory::getUser(); return "$user->email"; ?>
Of course you can use this code in many places, for example copying this code into the 'Default Value' of a Textfield Element (Quickmode and Classicmode), the result is showed in the next form.
Please note that you will only see the effect if you are logged in to our site!