• 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: Remove zero values on PDF submission

Remove zero values on PDF submission 3 years 7 months ago #41570

  • theworld
  • theworld's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
Hello,

I'd appreciate some help. I'm using range sliders to define specific values.

On the PDF, I'm trying to remove zero values submitted by the range sliders.

In the form properties, in User PDF Pre-processing PHP Script I'm placing the following scripts and the zeros are still showing on the PDF:

if (is_numeric($_POST)) {
$tmax = $_POST;
}else {
$tmax = 'null';
}

if (empty($_POST) && $_POST != 0) {
$tmax = null;
} else {
$tmax = $_POST;
}

if (!isset($_POST) || $_POST == '') {
$tmax = null;
}else {
$tmax = $_POST;
}


Can someone please advise what I'm doing wrong?

Thank you
The administrator has disabled public write access.

Remove zero values on PDF submission 3 years 7 months ago #41575

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 246
  • Thank you received: 64
I think I'd probably try this in the 'PHP scripts called on form process like this
if ($_POST['form']['slider_name'] < 1) {
 $_POST['form']['slider_name'] = null;
}
Then you could use the {if} tags in the pdf so that if it has no value it doesn't show
{if {slider_name:value}}{slider_name:value} {/if}
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
Last Edit: 3 years 7 months ago by iceferret.
The administrator has disabled public write access.
The following user(s) said Thank You: theworld

Remove zero values on PDF submission 3 years 7 months ago #41576

  • theworld
  • theworld's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
Thank you, this is helpful.

I think I need to adjust my mindset and rather use this to achieve the objective:

www.rsjoomla.com/support/documentation/r...mpaign=rsformpro-pdf
The administrator has disabled public write access.

Remove zero values on PDF submission 3 years 7 months ago #41577

  • theworld
  • theworld's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
@iceferret, thank you very much.

I just changed it slightly and it works perfectly!

if ($_POST = 0) {
$_POST = null;
}
The administrator has disabled public write access.

Remove zero values on PDF submission 3 years 7 months ago #41578

  • iceferret
  • iceferret's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 246
  • Thank you received: 64
These two articles are worth reading, the second article is a bit more in-depth but applies equally to PDF generation. I use it a lot particularly with membership forms where there are lots of options that may/may not have empty values

Using the if statement

and

Dynamically adjust email
If you can keep your head when all about you are losing theirs, then you obviously don't understand the situation!
The administrator has disabled public write access.
The following user(s) said Thank You: theworld
  • 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!