Passing Variables

TND Web

New Member
Hi. Just wondering if you can please help.
Ive got 2 calc elements in a form.
Im trying to pass the resulting variables from one to the other
(the first one that creates variables runs using ajax watch)
Ive spent hours trying to get this to work, but still no variable is passed

In First calc-
$session = &JFactory::getSession();
$session->set("login","session_value")

In second calc -
$session->get("login")

Please note, Ive just copied and pasted those from yet another tutorial ive read, actual variables are custom ones, and tried all different formatting
 
You can't use one calc element to calculate in an other calc element in the same form, it's not determined which one is calculated first.
You must do a "complete" calculation in every calc element.

So if calc1 is doing
return '{a}'.'{b}';

and you need calc2 to concatenate '{calc1}' and '{c}' you must do
return '{a}'.'{b}'.'{c}';
 
Thanks Troester
So, ive got one calc that contacts an external API to return vehicle details which it then places into variables.
one of which it creates is-
$vehicledescription = $colour . " " . $make . " " . $model;

I want the second calc to display some of those variables
To use $vehicledescription to display as part of a message to customer

therefore the first calc does not place this part of the information into the DB

How would your solution be formatted?
 
Oh, sorry, I just re-read that
So the whole php has to be submitted again?
Thats not gonna work, as it talks to an API that charges the site owner every time a query is submitted.
Surely there must be a way to store variables from main calc (the one that gathers the data from API) and use those elsewhere?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top