form that stores member info without data entry

How to install and use Contao

form that stores member info without data entry

Postby tmikk » Fri Jul 30, 2010 4:18 pm

I am creating a form that is only available to logged in members of the site. In that form I would like to capture the submitting member's username, real name, and email address without having the member fill out those fields. I should be able to capture this data from the tl_members table based on who is the logged in member submitting the form.

Any suggestions if there are extensions available that would accomplish this? If not, what would I need develop in order for this to work?
tmikk
User
 
Posts: 49
Joined: Mon Feb 01, 2010 9:07 pm

Re: form that stores member info without data entry

Postby Medianomaly » Fri Jul 30, 2010 8:38 pm

Try this and see if it works for you --

First, reference Contao's Insert tags for User Properties:
http://www.contao.org/insert-tags.html#user-properties

Create 3 new form fields -- one for each of the 3 pieces of data you want to capture. Each of these new fields should be of the type "Hidden Field".

Give each field a name, and for the default value, paste in the appropriate insert tag.

So the default values of your 3 form fields will be something like:
{{user::username}}
{{user::firstname}} {{user::lastname}}
{{user::email}}

Hopefully that will do the trick.
Brian | Medianomaly
User avatar
Medianomaly
User
 
Posts: 239
Joined: Fri Aug 21, 2009 3:02 am

Re: form that stores member info without data entry

Postby tmikk » Fri Jul 30, 2010 11:11 pm

This worked exactly as you described and was so easy to do! Funny that I had previously used an Insert Tag to display when the page was last modified, but didn't even think that I could use them in the form like this.

Thanks a bunch!
tmikk
User
 
Posts: 49
Joined: Mon Feb 01, 2010 9:07 pm


Return to Using Contao

Who is online

Users browsing this forum: No registered users