Filled formfield of logged in user

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
babel
Forum Members
Forum Members
Posts: 149
Joined: Fri Oct 19, 2012 8:58 pm

Filled formfield of logged in user

Post by babel »

If a user is logged in, I would like that his mailadres is allready filled in the form. Makes live a bit easier. I tried with "E-mail gebruikers die matchen aan een FEU-eigenschap" and

Code: Select all

{$username=feu_smarty::get_current_username()}
but the only thing I get back is
Er kan geen bruikbare FEU-eigenschap worden gevonden. Dit veld zal niet functioneren.
.
I only found viewtopic.php?f=13&t=74922 but that was not with a proper answer.
Using CMS Made Simple: 2.2.14, FEU 2.14.3.4, Formbuilder 0.8.1.6. The last two should be updated, but I don't think that the solution lies there. I hope someone knows it.
Sorry for mingling Dutch and English.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1825
Joined: Wed Feb 25, 2009 4:25 am

Re: Filled formfield of logged in user

Post by DIGI3 »

{feu_smarty::get_current_username()} is what I would use, so you'll need to investigate why it's not working. I'm guessing you're not putting it where a returned email address is what is wanted.

I would think the tag could just go in the "Default value" field of the email disposition, but I haven't tried it and can't remember if Smarty is valid there. If it's not, you would need to add it in the form template, or via javascript.
Not getting the answer you need? CMSMS support options
babel
Forum Members
Forum Members
Posts: 149
Joined: Fri Oct 19, 2012 8:58 pm

Re: Filled formfield of logged in user

Post by babel »

DIGI3: Thanks for your reply, but I have allready tried your advise. Because it doesn't work I asked for help.
babel
Forum Members
Forum Members
Posts: 149
Joined: Fri Oct 19, 2012 8:58 pm

Re: Filled formfield of logged in user

Post by babel »

Found the solution. Put in a hidden field the

Code: Select all

{feu_smarty::get_current_username()}
. It's what you proposed DIGI3.
Locked

Return to “Modules/Add-Ons”