Buy Now
Sign in

FAQ search

Creating a calculation form in Chronoforms6

Details
Published: Sunday, 04 February 2018 20:36

Assuimng your form has 3 fields, field 1, field 2 and field total, the fields "ids" are: field1, field2 and total respectively.

In your form designer, open "Custom" and drag a JavaScript element, open the settings and enable the "Load on dom ready", then add this code:

$("#field1,#field2").on("change", function(){
	$("#total").val(parseInt($("#field1").val()) + parseInt($("#field2").val()));
});

You may want to set an integer mask for your fields and set the default values to 0 based on your requirements.