TOPIC:

Easiest way to prepopulate a form with user data 8 years 8 months ago #107237

  • Topic Author
  • rpupkin77
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 1
  • Thanks: 0
Hi,

Say I have a form on a page with restricted content (registered users only). Is it possible to prepopulate some of the fields with the logged in user's data?

If so are there docs on the subject?

Sorry, if this is a repeat, i searched the forums but did not see an exact answer. I am trying to decide if we want breezing forms or a different extension, this seems to be big to my client.

thanks.

Please Log in or Create an account to join the conversation.

Easiest way to prepopulate a form with user data 8 years 8 months ago #107368

  • chrisal's Avatar
  • chrisal
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 6983
  • Karma: 187
  • Thanks: 630
Hello rpupkin77,

which user's data do you need?

Please copy this code into the 'Default Value' of the Element in the Element options:

Name:
<?php $user = JFactory::getUser(); return "$user->name"; ?>
Username:
<?php $user1 =& JFactory::getUser(); return $user1->username; ?>
User id:
<?php $user2 =& JFactory::getUser(); return "$user2->id"; ?>
Email:
<?php $user3 = JFactory::getUser(); return "$user->email"; ?>

and save.

Here is a small Sample form:

File Attachment:

File Name: UserInfo.zip
File Size:7 KB



regards
Chris
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: Post by chrisal.
  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.045 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!