How to pre fill email and name in contact form for registere

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
cojimar
Joomla! Apprentice
Joomla! Apprentice
Posts: 35
Joined: Sun Sep 18, 2011 6:44 pm

How to pre fill email and name in contact form for registere

Post by cojimar » Sun Feb 26, 2012 10:08 pm

Hello there,

Does anyone knows how to pre fill fields in forms for registered users?? What i need is make it simple for user once they log in they dont have to re type email, name and so on.

Any help will be appreciate, thanks.

cojimar
Joomla! Apprentice
Joomla! Apprentice
Posts: 35
Joined: Sun Sep 18, 2011 6:44 pm

Re: How to pre fill email and name in contact form for regis

Post by cojimar » Mon Feb 27, 2012 1:38 am

Solved!!! just place this code in default value if you are using rsformspro.
//<code>
$formuser=JFactory::getUser();
return $formuser->email;
//</code>

and this for username:

//<code>
$formuser=JFactory::getUser();
return $formuser->username;
//</code>

:D


Locked

Return to “General Questions/New to Joomla! 2.5”