• 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: Conditionally Combining fields to use in a PDF

Conditionally Combining fields to use in a PDF 7 years 3 months ago #37694

I have a form that collects names of several partners on a project. The form sends an email with a pdf attachment. I want the attachment to include a different title depending on the number of partners.

If there is one partner I want the title to be "{First Name:value} {Last Name:value}", but if there are two partners I want the title to be "{Last Name:value} and {Partner1 Last Name:value}".

I've thought about creating a hidden field and concatenating the names in the hidden field, but I don't know how to use an if statement in the hidden field.

I've thought about using the PHP preprocessing, but there are no instructions on calling values from the form.

Please advise/help.
The administrator has disabled public write access.

Conditionally Combining fields to use in a PDF 7 years 3 months ago #37749

I made progress. I used the following code in the "Script Called on Form Process":

if ($_POST == 'Individual Project') {
$_POST = $_POST . " " . $_POST;
} elseif ($_POST == 'Group Project (2 partners)') {
$_POST = $_POST . " and " . $_POST;
} elseif ($_POST == 'Group Project (3 partners)') {
$_POST = $_POST . ", " . $_POST . " and " . $_POST;
}

Unfortunately, the if statements always evaluate to false... why?
The administrator has disabled public write access.

Conditionally Combining fields to use in a PDF 7 years 3 months ago #37750

Sorry, my $_POST fields were stripped, but I think you get the point.
The administrator has disabled public write access.

Conditionally Combining fields to use in a PDF 7 years 3 months ago #37751

I did a var export on the $_POST value and discovered that it is an array?! The field value I was using was from the paypal plugin for multiple products, which apparently puts an array into the post field. So I simply added the key, which was 0 to get the right value out for comparison and it works perfectly. Problem solved!
Last Edit: 7 years 3 months ago by mark.hobbs.
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!