• 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: Data preview using PHP Javascript

Data preview using PHP Javascript 2 years 3 months ago #42470

Hello, I'm creating a form that contains fields that need to be multiplied (fieldA * fieldB). However, fieldA has a variable value depending on an entered amount, example:

if fieldA >= 1 the unit value is 5 - resulting in (value*5) or
if fieldA >= 10 the unit value is 4 - resulting (value*4)
this result of fieldA will be multiplied by fieldB (which may or may not have a fixed value).

I'm solving it with php like this:
if ($_POST['form']['fieldA'] >= 1)   { $result = 5; }
if ($_POST['form']['fieldA'] >= 10)   { $result  = 4; }
$_POST['form']['result'] = ($result ) * $_POST['form']['fieldB'];

So far so good, but I found a way to display the result of the form before sending it to the email with this tudorial:

[url=http://https://www.rsjoomla.com/support/documentation/rsform-pro/custom-scripting/preview-data-before-submit.html]https://www.rsjoomla.com/support/documentation/rsform-pro/custom-scripting/preview-data-before-submit.html[/url]

But the result of operations in php doesn't work and I haven't found a solution for that.

In short: My objective is to print on the screen the result of the operations performed in php so that the user can check if the values are in agreement, being able to go back and change them before sending the form by email.
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!