Skip to Content Skip to Menu

PHP Auto fill Form using getUser / Breezing Forms

13 years 8 months ago #154069 by joshuamaddux
Hi all,

I have a site im working on and I have it auto fill the form fields. I am using Breezing Forms and Community Builder. Im able to auto fill the Name and E-Mail in Breezing Forms with the code below.
Code:
<?php return JFactory::getUser()->get('name'); ?>
Code:
<?php return JFactory::getUser()->get('email'); ?>

However, when it comes to auto filling a field that is pulling from CB and filling Breezing Forms Im having no luck. :( I have tried all of the below code with none of it working. Some of it returns a error and some of it returns a blank page.
Code:
<?php return JFactory::getUser()->get('name'); ?> <?php return user_info()->get('cb_companyname'); ?> <?php return $companyname = $user_info->cb_companyname; ?> <?php return JFactory::companyname = $user_info->cb_companyname; ?> <?php return JFactory::user_info->cb_companyname; ?> <?php return JFactory::companyname->cb_companyname; ?> <?php return JFactory::companyname()->get('cb_companyname'); ?> <?php return JFactory::getUser()->get('cb_companyname'); ?>

Thank you all very much for all you do! Normally I am able to debug these on my own but im not having any luck this time.

Joshua

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

  • GUEST
13 years 7 months ago - 13 years 7 months ago #158669 by
Hello Joshua,
Did you ever solved your problem of retrieving CB fields into Breezing Form?
I have the same issue and not know how to do. Users MUST be registered users to fill my for. I "just" want to obtain the username and email of the user who is submitting the form.
Where exactly do you enter <?php return JFactory::getUser()->get('name'); ?>, in the "Value" of the hidden field? In an script? And is it the same code on all systems? I mean, is it JFactory on my system as well.
Thank you very much for your help.:S
Alek
Last edit: 13 years 7 months ago by . Reason: Forgot a item

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

  • GUEST
13 years 7 months ago #158671 by
Hello Joshua,
I have made it work using the "Value" field. :) But It is not exactly what I wanted, it only works if the field is a textfield. For some reason, it does not work as "hidden field". This what I wanted because I only wanted to show the username on the list view. But it is workable.
Thank you,
Alek

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

13 years 7 months ago #158678 by joshuamaddux
Alek,

Im glad you were able to get it to work. I could not get it to work if I placed it as hidden. I see it as a convenience thing. If the users coming to the site have there profile fully filled out it will auto fill almost everything. However, if they only have the required filled out then they have to fill out most of the form.

Let me know if you need any more help with it.

Joshua
The following user(s) said Thank You:

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

  • laztech
  • laztech
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
11 years 11 months ago #214934 by laztech
I'm having pretty much the exact same situation as this, I know this thread is almost two years old, but I also don't see a final solution to pull the data from CB into Breezing forms, if you still hang around here Joshua, did you ever find a solution to this?

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

Moderators: beatnantkrileon
Powered by Kunena Forum