Page 1 of 1

Filled formfield of logged in user

Posted: Tue May 12, 2020 8:22 pm
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.

Re: Filled formfield of logged in user

Posted: Tue May 12, 2020 9:04 pm
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.

Re: Filled formfield of logged in user

Posted: Wed May 13, 2020 8:33 am
by babel
DIGI3: Thanks for your reply, but I have allready tried your advise. Because it doesn't work I asked for help.

Re: Filled formfield of logged in user

Posted: Wed May 13, 2020 8:46 am
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.