• 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: Add digits to a global variable

Add digits to a global variable 2 years 6 months ago #41505

Hello.

I have 2 questions depending on the possibility.

I want to use the SubmissionId in PHP Script called on form process. How can I do that?
I can use it at PHP > Script called after form has been processed as $sub_id = str_pad($SubmissionId, 8, "0", STR_PAD_LEFT); but I guess it's not generated yet, when the form is in process.
So how can I obtain this value? The goal is to use this value and paste in the generated PDF.

When I paste the global variable {global:submissionid} in the PDF Layout HTML, that is working, but I need to have a value with 8 digits, so how can I edit this global so that I have 8 digits (so 00000790 instead of 790)

Thanks for feedback!
The administrator has disabled public write access.

Add digits to a global variable 2 years 6 months ago #41513

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

The submission's ID is naturally generated after the form has been submitted. You can't get it within the "Script called on form process" because it hasn't been generated it - the form hasn't yet submitted its information in your database.

You could use "Script called after form has been processed" though it would depend on when is the PDF file being generated. This will only work if the PDF is generated on a later time as you would need to modify the database information. For example:

- use a hidden field.

- use a script within the "Script called after form has been processed" area that adds these zeroes to your submission ID and saves its value in the hidden field information directly by adjusting the database: #__rsform_submission_value

- you have the $SubmissionId variable available within this particular scripting area to return the submission's ID.

- eventually in your PDF you would use the hidden field's placeholder instead.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

Add digits to a global variable 2 years 5 months ago #41607

Indeed, this isn't working. I tried other ways.

Still some questions:
1. Any idea how I add digits to a global variable -> -{global:submissionid}. I need to have a value with 8 digits, so how can I edit this global so that I have 8 digits (so 00000790 instead of 790).

2. You mention "...saves its value in the hidden field information directly by adjusting the database: #__rsform_submission_value" but how do I do that?

Thanks!
Last Edit: 2 years 5 months ago by djieply.mai.
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!