CalcBuilder Forum

Access matrix values from Javascript

User moon_1868 2014-12-11 01:27:09

Hi,

Is there a way to access the matrix values from Javascript?

I have created several matrices inside Calc Builder and it is clear how to access the values from PHP, when submitting the form. But what if one needs to perform some calculations via Javascript and need the matrices values?

Is there a way or is it necessary to recreate the matrices as Javascript objects ?

Thanks for the assistance

Elena

Moonsoft support 2014-12-11 08:58:11

Hi,
the matrix is intended to be used at calculation time, so its available only at the code section, there's no direct/simple way to access database using javascript. If you need to perform additional calculations at the form with js, then you would need to create all needed sources at the javascript section.

Please note you have available a field type 'inline result', which performs the calculations using the php code, and it refreshes the result at the input form, so it may be used to replace javascript calculations and you could use your matrix.


Hope this helps, regards

User moon_1868 2014-12-11 15:59:36

Hi,

Thanks for your reply.

I think in the end I will create the matrices in Javascript too, anyhow, I find very interesting the inline field.
Can you tell me where I can find more info about how to set this field and its dynamic value ?

Elena

Moonsoft support 2014-12-11 17:10:43

Hi,
the inline field only needs to be shown at the input form, and you assign a value for it at the calculator code, as any other variable you handle for the output. You can find a working example of an inline form at your customer area-calculator examples- inline results. Just unzip and import at your calcbuilder backend to check how they are used. Please let us know if you need more help with this.

Thanks, regards

...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!
...
List Manager

Build different lists for your site

Buy now!