Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

Check Results 08.04.2015 12:53

Hello,

I would like to validate results.
For example if a result value is greater than 100 i need to pop a window.
I set up javascript on "Executed after calculate execution" tab like this:

var result=cb_getValue('IRR'); //IRR is a php value from code section
if(result>100) window.alert("ERROR");

But it doesen't seem to work.

Is there anything i can do to get result variable?

Thank you

Re: Check Results 08.04.2015 16:19

Hello,
in case you want to handle your calculator results when you're back on the page, you need to 'print' the value in order to allow javascript to read it and execute any action.

You can write a hidden field at your ouput section (please replace [ and ] for the html tags)

[input type="hidden" value="##IRR##" id="myresult"/]

So at the javascript section you can recover this field value at the

"Executed after calculate execution" tab:

var result=CB("#myresult").val();

//and launch here the proper actions according to the result.

Hope this helps, regards
Moonsoft Team
www.moonsoft.es
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect
FaLang translation system by Faboba

Our clients' feedback