• 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: Joomla User ID in Hidden Field

Joomla User ID in Hidden Field 12 years 7 months ago #19086

  • andrew.rapp
  • andrew.rapp's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 2
Hello,

I'm trying to capture the Joomla ID of the user who is logged in and completing the form. Working from some code examples, I've tried making this the default value of the hidden field:

//<code>
$user =& JFactory::getUser();
$usrid = $user->get('id');
return $usrid->loadResult();
//</code>

However, that causes the page not to load. I need to get the user's id so I can properly map fields to another component. Can anyone see what might not be working with this code, or suggest a revision? I'm not a developer, so I'm just guessing at the syntax.

Thanks!
The administrator has disabled public write access.

Re: Joomla User ID in Hidden Field 12 years 7 months ago #19088

  • andrew.rapp
  • andrew.rapp's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 2
Solved my own problem! In case it helps anyone, just remove '->loadResult();' from the code below.
The administrator has disabled public write access.
The following user(s) said Thank You: flexconcept, janekapmann
  • 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!