Forums

How to automatically enter the login user name in the text field?

sylwekb 04 May, 2021
I wanted to create a form for registered and logged in users. How to automatically enter the login user name in the text field? What code and where to enter this field when creating the form? This field is not meant to change and should be retrieved from the Joomla user base.

Greetings
healyhatman 05 May, 2021
If it's anything like CF6 it'll be {user:username}. Should be able to just use {user:} to see the available data.
GreyHead 05 May, 2021
Hi sylwebk,

Please see the 'Shortcodes Cheat Sheet' icon between the ? and X at the right of the header bar on the Forms tab.

Bob
sylwekb 10 May, 2021
Answer
Thank you. The described method works. Is it possible to set a greyed out field that cannot be edited? Where should I place such a text box so that users cannot edit it?
e.g.
readonly="readonly"

Works ! Behaviors --> Custom tag atribute html --> add readonly
You need to login to be able to post a reply.