You are viewing limited content. For full access, please sign in.

Question

Question

Can I build a "Calculate" button that would only force all calculations to run?

asked on August 27, 2020

I have built a form that will never be submitted.  It is just for the general public to plug in their property value and make one other choice to then get an idea of what their taxes on that property will be.

The form is working great, however, if a person does not tab out of the fields required for the calculation, the calculation result does not populate.

The solution to the problem could be a "Calculate" button that the users could press to for the calculation to run.  It would not launch anything else.  (The Submit button is hidden.)

Is this possible.

0 0

Replies

replied on August 27, 2020
$(document).ready(function() {
   $('.value-input input').keydown(function() {
      $(this).change(); 
   })
});

Hey Connie, try this script. The root of the issue is that the form only calculates when the "change" event fires, not the "keydown" event. This script will just tie those two together, so that every time the 'keydown' event fires it also fires the 'change' event which lets your form calculate.

Make sure to add the value-input CSS class to your form field!

1 0
replied on August 27, 2020

Thanks, Brian.  Unfortunately, for some reason, that is causing the $ field to not allow more than one digit in it.  When I take the coding back out, I can type in as many digits as I want again.  It does not make sense that it would cause that, but...

1.00   vs   100000.00

0 0
replied on August 27, 2020

Actually, I found that if I switch the two fields around, so that the value field is the first field to be filled in and the radio button is the second field they fill in, that solves the problem without any coding.  The third field (the calculation results) activates as soon as a radio button is picked.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.