Help with Form Calculations not working

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
rongreen
 
 
Posts: 156
Joined: Thu Jun 06, 2024 4:36 pm

Help with Form Calculations not working

Post by rongreen »

I could use some help. I cannot seem to get the field In-StockSubTot (name:InStockSubTotal) to total. The formula in its condition box is set to:

Number([InStockItem1Subtot])+Number([InStockItem2Subtot])+Number([InStockItem3Subtot]) with the target set to InStockSubTotal. I tried putting it in InStockItem1Subtot, InStockItem2Subtot, and InStockItem3Subtot with same results, not calculation happening. What am I doing wrong? Thanks for the help.



https://www.greensphotoimages.com/alljo ... lation.zip
User avatar
Pablo
 
Posts: 23239
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Help with Form Calculations not working

Post by Pablo »

Can you please remove everything from the page that is not relevant to your question, so I do not have to go through the settings of dozens of items? Otherwise it will take me a lot of extra time to try to help.

For further details about how to share a project file, please see this FAQ:
viewtopic.php?f=10&t=82134
rongreen
 
 
Posts: 156
Joined: Thu Jun 06, 2024 4:36 pm

Re: Help with Form Calculations not working

Post by rongreen »

As requested, I stripped the form fields and grids that were not relevant and reattached the updated project.

In the interim, my wife and I kept working at it and did make some progress. However we would appreciate your looking at and providing input on our approach and critiquing it. I suspect our choice was not the best or optimal one. We did try putting a formula in the InStockItem1Subtotadding field summing all three subtotal fields, but could not get it to work. Not sure why? So we have two requests:

1) Help with the formula in terms of where it should actually go and if we wanted to put it into the first subtotal field what it should look like?
Here is what we used that worked: Number([InStockItem1DropDown])+Number([InStockChainLen1])+Number([InStockItem2DropDown])+Number([InStockChainLen2])+Number([InStockItem3DropDown])+Number([InStockChainLen3])

2) What do we need to do to end up with a number that is limited to two decimals (e.g. $xx.xx)? Right now, certain selections end up with the In-Stock Subtotal populating a number that looks like 44.410000000000004.



https://www.greensphotoimages.com/alljo ... tionv2.zip
User avatar
Pablo
 
Posts: 23239
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Help with Form Calculations not working

Post by Pablo »

Unfortunately I do not have too much free time to look into this because I am very busy preparing the release of the new version.
But keep in mind however that this is not specific to WWB, but JavaScript and programming in general.
All JavaScript that works in a normal HTML page, will also work in WWB.

Your formula seems to be correctly implemented.

In JavaScript you can round numbers with 'toFixed', as mentioned here:
https://www.wysiwygwebbuilder.com/conditions.html
rongreen
 
 
Posts: 156
Joined: Thu Jun 06, 2024 4:36 pm

Re: Help with Form Calculations not working

Post by rongreen »

Thank you for taking time to look into my inquiry. Your response met out need. Looking forward to seeing what the future release offers.
Post Reply