Form Calculations

Issues related to forms.
GPK5050
 
 
Posts: 65
Joined: Thu Apr 26, 2018 4:03 pm

Form Calculations

Post by GPK5050 » Mon May 07, 2018 2:19 pm

Hi all...

I am almost there with this form, but something is stumping me....

The page in question is:

http://carpenters50th.com/registration3.php

and it's about daily registration portion of the form in the middle.

I've got it set up so when the check mark on the left is chosen, the appropriate value of that event is populated on the box on the right (the first box is pre-populated). I've got it set up with a conditions line in the first box to add up all the totals to appear in the bottom box. The box labeled "Previous Donation" is supposed to subtract the number in that box. The calculations work but only if you click somewhere next to the boxes. And if you remove a check mark, the Grand Total box will only recalculate if you remove the number from the "Previous Donation" box and then click again somewhere on the form page.

Any suggestions on how to correct this problem?

My expression line in the first box is:

Number([Registration_Calc])+Number([Thursday_Tour_Calc])+Number([Free_Day_Calc])+Number([Saturday_Tour_Calc])+Number([Saturday_Gala_Calc])+Number([Complete_Event_Calc])-Number([Previous_PayPal_Payment])

Thank you!

Greg

User avatar
Pablo
 
Posts: 14554
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form Calculations

Post by Pablo » Mon May 07, 2018 3:05 pm

Unfortunately, updating the value of an editbox via a checkbox will not trigger a 'change ' event (which is used to update the calculation) in the browser. The calculation will only be updated if the value if the value is changed manually.
I think what you are trying to do can only be done with custom code. I have quickly tried to write some code for you, but it require a few hours to figure this out.
At the moment I am very busy with the release of the new version so I cannot spend too much time on this.
I will try to look at this later this week.

GPK5050
 
 
Posts: 65
Joined: Thu Apr 26, 2018 4:03 pm

Re: Form Calculations

Post by GPK5050 » Mon May 07, 2018 3:16 pm

Hi... AND THANK YOU!!!!!!

It would be most appreciated!

Let me know when you have something!

And thank you for V14!

Keep up the good work!

Greg

GPK5050
 
 
Posts: 65
Joined: Thu Apr 26, 2018 4:03 pm

Re: Form Calculations

Post by GPK5050 » Fri May 11, 2018 3:24 pm

Hi...

Any luck with a fix for my calculations?

Thanks again...

Greg

User avatar
Pablo
 
Posts: 14554
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form Calculations

Post by Pablo » Fri May 11, 2018 3:35 pm

In the latest update there is a new option that makes it possible to trigger a 'change' event.
You can use this to force an update of the calculation from the checkbox.
https://www.wysiwygwebbuilder.com/forum ... =1&t=80711

GPK5050
 
 
Posts: 65
Joined: Thu Apr 26, 2018 4:03 pm

Re: Form Calculations

Post by GPK5050 » Fri May 11, 2018 4:13 pm

Hi...

I downloaded the update and I see the new entry in conditions. But where and how should I add this condition.

Thank you!

Greg

User avatar
Pablo
 
Posts: 14554
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form Calculations

Post by Pablo » Fri May 11, 2018 4:32 pm

Add it in the checkbox conditions after the other two other actions.

GPK5050
 
 
Posts: 65
Joined: Thu Apr 26, 2018 4:03 pm

Re: Form Calculations

Post by GPK5050 » Fri May 11, 2018 4:51 pm

Hi...

That is working perfectly!!! You're a genius!

Now, one last issue on my form. Is there any way to have a reset button to have the contents of just one the edit boxes to be cleared out? The button in question is the Previous Donation button which subtracts an amount from the Grand Total.

Thanks again for all your hard work on this!

Greg

User avatar
Pablo
 
Posts: 14554
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form Calculations

Post by Pablo » Fri May 11, 2018 4:56 pm

That will require JavaScript.
For example:

Code: Select all

$('#Previous_PayPal_Payment').val('');

GPK5050
 
 
Posts: 65
Joined: Thu Apr 26, 2018 4:03 pm

Re: Form Calculations

Post by GPK5050 » Fri May 11, 2018 5:26 pm

Hi...

I didn't realize how complicated this all could be!

So that work (I'm surprise I figured out what to put where!). But the one thing that it does not do is to recalculate the Grand Total box when the amount is removed from the box.

Any fix for this?

Thanks again...

Greg

User avatar
Pablo
 
Posts: 14554
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form Calculations

Post by Pablo » Fri May 11, 2018 5:30 pm

Maybe adding this in the same event?

Code: Select all

$('#Previous_PayPal_Payment').trigger('change');

GPK5050
 
 
Posts: 65
Joined: Thu Apr 26, 2018 4:03 pm

Re: Form Calculations

Post by GPK5050 » Fri May 11, 2018 5:44 pm

PERFECT!!!

Thank you so much for all your help! I could not have completed my vision without you!

I so wish I understood this more....

Oh well!

Greg

User avatar
Pablo
 
Posts: 14554
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Form Calculations

Post by Pablo » Fri May 11, 2018 5:51 pm

Always happy to help another Carpenters fan :D

User avatar
BaconFries
 
 
Posts: 4190
Joined: Thu Aug 16, 2007 7:32 pm

Re: Form Calculations

Post by BaconFries » Fri May 11, 2018 6:11 pm

Pablo always the 'Superstar'🎤

GPK5050
 
 
Posts: 65
Joined: Thu Apr 26, 2018 4:03 pm

Re: Form Calculations

Post by GPK5050 » Fri May 11, 2018 6:41 pm

:D :D :D :D :D :D :D

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests