CalcBuilder Forum

Hide calculate button and click it

Usuario moon_1859 2015-05-11 21:18:36

Hello again!

As you told me, I can force calculation by simulating a click the calculate button:

CB("input").click();

Now let's have it a little more tricky: I'd like to use "Hide Calculate button and get results on change value of every field" - then, the script above doesn't work because there's no calculate button. Is there a way to combine both functionalities? Do I have to add an onblur event to every input field and fire the calculate click?

Best regards

Alex

Moonsoft support 2015-05-12 08:49:43

Hello,
when you 'hide' the calculate button from the configuration, the button is not present, so the event function won't work for it. You could hide it from the script instead:

CB("input").hide();


but if you also need to trigger calculation on every field change, then the better approach would be to use the configuration, and trigger the change event of any of the fields to launch calculation instead. Let's say you have a field with var name= myfield1 , you could use:

CB("input").change();


to trigger onchange event, that will trigger calculation according to your configuration.

Hope this helps, regards

Usuario moon_1859 2015-05-12 15:44:05

Thanks a lot!

...
Support/development

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

Buy now!
...
CalcBuilder

Create dynamic calculators

Buy now!