• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Using CB data in a form

Using CB data in a form 9 years 7 months ago #32569

  • Burnardo
  • Burnardo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Thank you received: 1
First of all I will apologize if this question seems to have been answered on different locations in this forum. After reading through many possible or part-solutions, I have tried various examples but none really worked.

Kindly bear with me on my question:

After a user is logged-in. The Community Builder User data (yes, I use CB for user data) will be known and is supposed to be available for use. I can now even use "curly"-code in HTML articles to display parts of these user-data due to a nice plugin, but that is beside the point for this question.

In my example form I have a texbox which is NOT displayed on the frontside. It needs not be displayed as it should should contain the fullname of the person that is logged in. (most people already know their own name...)
I am using this textbox, so that when the form is submitted, I can use it in a submission directory and submission list.
Other logged-in visistors with proper rights, are then able to see this submission directory and submission list in order to view which users have already sent in their form, and with which details.

So far that is the situation...
Now the problem is that I cannot get the fullname of the logged-in user, which is supposed to be filled in the fullname textbox, to display in the submission directory or list.

For the purpose of filling the texbox I use:
- Name, "Naam"
- Caption, "Volledige naam"
- Placeholder, {global:fullname}

This last part {global:fullname} is supposed to fill in the value of "Name" with the proper CB value, but for unknown reason that does not happen...

What am I doing wrong?

Thanks for your time to help out on my probably silly question.
Ben van Wetten
The administrator has disabled public write access.

Using CB data in a form 9 years 7 months ago #32572

  • Burnardo
  • Burnardo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Thank you received: 1
In one of those attempts I tried the following:

For the purpose of filling the texbox I use as a placeholder:

//<code>
$user = JFactory::getUser();
return $user->get('name');
//</code>

This PHP code should then result in insertion of the fullname of the logged-in user. This solution is stated in several topics.
But... in my case this does not work. It does NOT result in a full name as a part of the resulting form list or directory.

Still looking for a working solution...
Thanks for your time if you cab help me,
Ben van Wetten
Last Edit: 9 years 7 months ago by Burnardo.
The administrator has disabled public write access.

Using CB data in a form 9 years 7 months ago #32573

  • Burnardo
  • Burnardo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Thank you received: 1
OK, again 1 step closer...

Now used this code for the textfield (default value):

//<code>
$user = JFactory::getUser();
return $user->get('fullname');
//</code>

But the big change is:
I now used automatic layout of the form. This leads to the (unwanted) display of the textfield with the full name on frontside. But...

...at least now this field is also "captured" and displayed by the submission list.

Already in the first moments of my attempts I had decided NOT to use a "hidden field" method. This was because also in such a case the submission fields were not using the wanted field coming from the hidden component".

I may now have to re-consider this approach...

Hope this will also help others to guide me in a quicker way towards a working solution,
All suggestions are appreciated,
Ben van Wetten
The administrator has disabled public write access.

Using CB data in a form 9 years 7 months ago #32576

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Let me see if i get this straight... You are trying to capture information about the current user (that is registered and filling the form), but not display it in the frontend ? If this is the case, hidden fields are the way to go then.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Using CB data in a form 9 years 7 months ago #32577

  • Burnardo
  • Burnardo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Thank you received: 1
Thanks alexp,

Just now used it in a correct way. The hidden field now contains the previously mentioned code:

//<code>
$user = JFactory::getUser();
return $user->get('name');
//</code>

Apparently I had made a mistake in my previous attempts, but it now works as I want it to work.
The name of the logged-in person is not shown in the form (as a person is already aware of his/her own name) but the name needs to be taken in as information by the form in order to be used in the submission list. Otherwise you are unable to see who submitted the form.

Now still figuring out a nice way to configure display of submissions and a submission list, but that is a different chapter and (in my humble opinion...) solvable.

Thanks for looking into it.
Ben van Wetten
The administrator has disabled public write access.

Using CB data in a form 9 years 7 months ago #32578

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Standard user related information can be extracted using some of the global placeholders. Have a look here:

https://www.rsjoomla.com/support/documentation/rsform-pro/getting-started/how-to-configure-emails.html

You can simply use these placeholders in: Emails, Thank you message, mod_rsform_list, Submissions View (basically anywhere you would use regular field placeholders).
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Using CB data in a form 9 years 7 months ago #32579

  • Burnardo
  • Burnardo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Thank you received: 1
Thanks alexp,

That information already got me on this track.

Now I am working on changing the HTML code for the menu item.
This menu item should show the submission list.

I am working on using a nice header with general information in the top of the table. It still looks a bit barren and does not yet show the correct subjects as a header.

This all done in the Menu item for submission list:
HTML layout, Row layout, Detail layout.

Thanks for now Alexp. I am the right track again,
Ben van Wetten
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!