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

Question

Question

Forms Calculations - Update Total when user removes value from a field

asked on April 4, 2024

This form has a calculated field with the Total of the Subtotal, Tax, and Shipping cost.

But we want it make it so that if the user clears a field, it does not keep the original value in the total calculation. How can we do this without using JS?

0 0

Answer

APPROVED ANSWER
replied on April 8, 2024

I can reproduce and the workaround does not work either ref #517426

1 0

Replies

replied on April 4, 2024 Show version history

Change it to:

=IF(EQ(Tax,""),"",SUM(Subtotal,Tax,Shipping_Cost))

If Tax is empty, then the total is blank. Could repeat for the other fields if needed.

 

Edit: I think I misunderstood your requirements. It sounds like you want it to recalculate when the field is blank, not require that it has a value. Maybe changing the default value to 0 would resolve this issue?

0 0
replied on April 4, 2024

I tried both solutions, your IF workaround first and that did not change anything. Then I tried the default value for Tax but no luck there either. A default value is a value entered into a field if and only if the variable is blank on load.

0 0
replied on April 4, 2024

Hmm I'm on self-hosted and it just works without doing anything special. Using your original formula, as soon as I click off the tax field, the total updates. Must be a cloud bug.

0 0
replied on April 4, 2024

After deleting the value, if you click off of the field, does the Total field update correctly?

0 0
replied on April 4, 2024

No, this is when I want it to update the total, when the user unfocused the field leaving a blank value. In the video you can see I am clicking off the field and it is not updating, the value will not be correct until after submission in the variable left over.

0 0
replied on April 4, 2024

I couldn't tell if you were clicking off the field or not, thanks for clarifying. Seems like a bug to me.

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

Sign in to reply to this post.