xsanisty/calx.js

How can one "trigger" a recalculation manually?

cyphix333 opened this issue · 3 comments

Is there a way to trigger the recalculation of all the fields of the form? Say if I want to bind it so that it recalculates on users typing (with a second delay for example); I'm just concerned about users seeing the wrong values if they go right for the submit button right after entering data and the field never losing focus forcing a recalculation.

Thanks!

You can change the event that trigger the calculation, by default is blur, but you can change it to keyup or keypress for more realtime response

$('#form').calx({autoCalculateTrigger: 'keyup'});

Ahh thanks for that :)

Just found out if you want to manually trigger a calculation however you can do...

$(selector).calx('calculate');