CalcBuilder Forum

Enforce calculation / push value to inline result

Usuario moon_1859 2015-04-27 09:09:38

Hi,

I've got two questions:

1. How can I push a value via JavaScript from "outside" to an inline result? Using cb_setValue('myvar','NEW_VALUE'); doesn't work with inline results. Do i have to fill a helper field?

2. Is there a way to call calculation via JavaScript?

Moonsoft support 2015-04-28 08:43:56

Hi,
the setvalue function is only valid for input fields. If you have the need to set values from js to an inline field, you need to check first which is that field ID at the calculator field section, with that number (for ex, ID=34) you can use:

CB("#fld_34").html("New value");

You can also call calculation, just sending the 'click' event to the calculate button, it would be:

CB("input").click();


Hope this helps, regards

Usuario moon_1859 2015-04-30 21:55:10

Works perfectly! Thanks a lot!