Pre filled text boxes with Breezing Forms / FacileForms |
It is often useful to have the username and/or email address of a logged in user pre-filled in your Breezing Forms / FacileForms form. Here is how to have the username and email address automatically entered in your Breezing Forms / FacileForms form. ![]() Make a new text input as normal. In the value box paste the following code for the username - <?php $user =& JFactory::getUser(); return $user->get('name') ;?> For the email address use the following code - <?php $user =& JFactory::getUser(); return $user->get('email') ;?> You can also show a dynamic greeting depending on whether the user is logged in or not. Make a normal Static Text/HTML element. In the Text/HTML box use the following code - <h2>Welcome <?php $user =& JFactory::getUser(); if ($user->get('name') != '') return $user->get('name'); else return 'Visitor'; ?></h2> ![]() |
Last Updated on Wednesday, 16 December 2009 14:40 |