• 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: Changing submission user ID on form submit

Changing submission user ID on form submit 4 years 8 months ago #40443

  • mike21
  • mike21's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hi,

I have a form which is submitted by admins concerning current joomla users.

There is a dropdown which is a lookup from the _users table in joomla which returns the user's name and ID.

On the form submit, i want the submission to be as if the user has submitted it themselves, so that in the front-end, the user can use the directory view to see their "own" submission.

I tried using the mapping function on form options, but this just creates another submission in the table rather than using the existing one.

Any suggestions?

Thanks,
The administrator has disabled public write access.

Changing submission user ID on form submit 4 years 8 months ago #40444

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You can find an example on this topic here. More precisely the "Database mappings" section explaining how such a mapping would be configured (in your case, replace the {student:value} placeholder with the exact placeholder of your dropdown that returns the user's ID).
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

Changing submission user ID on form submit 4 years 8 months ago #40455

  • mike21
  • mike21's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Great, thank you for that!

The only issue with the user lookup is that now on the directory listing view, the data is showing the user ID rather than the student's name, any tips on how to change this? I know you can change the layout of the details form easily, but can't see a way to edit the directory.
The administrator has disabled public write access.

Changing submission user ID on form submit 4 years 8 months ago #40470

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Only the value is normally shown for your field, in this case the ID, and not the label. For the label itself, the name, you can try adding an extra field in your form like a hidden field and pass the dropdown label selection within your hidden field value (you can use JavaScript for this).

Edit your dropdown > Attributes > Additional Attributes area > add:
onchange="document.getElementById('myHiddenFieldName').value = this.options[this.selectedIndex].text;"
Replace myHiddenFieldName with the exact name you've given to your hidden field (case sensitive). Eventually in your Manage Directory configuration, exclude the dropdown from showing and include the hidden field instead.
This is not official customer support. To receive your support, submit a support ticket here.
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!