Help with getting subtotal to show

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 getting subtotal to show

Post by rongreen »

I have inserted into the Page HTML code into the "Between Head" and "Body Attibutes". When I preview it in the Browser or run the published version and use Inspect to show the console it is performing as expected. It shows the calculated subtotal based on the dropdown choices made for:
CustomItem1Select, CustomItem1PatternSelect, CustomItem1BraceletClasp, and CustomItem1Chain. What I am having trouble with is how to get the calculated amount to show up in the Subtotal1 Editbox? Thanks for any suggestions or help offered.



https://www.greensphotoimages.com/subto ... 1_1_25.zip
User avatar
Pablo
 
Posts: 23564
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Help with getting subtotal to show

Post by Pablo »

I'm sorry, but I cannot give support on custom code.

However, all elements on the page are standard HTML. So, any code that works in a standard HTML page will also work in WWB.
rongreen
 
 
Posts: 156
Joined: Thu Jun 06, 2024 4:36 pm

Re: Help with getting subtotal to show

Post by rongreen »

Thanks for responding. Let me ask what I hope is a yes or no question. Is it even possible to cause the results of a code based calculation to be displayed in a form field? I have this code defined variable called Subtotal1 that is the same name as that of a form field’s ID and Name and I thought that would allow the calculated value of Subtotal1 be reflected in the form field. So what I am asking is this possible? To be clear, I am not asking you, or anyone else on the forum, to tell me how, but is this possible, even through additional custom code?
User avatar
Pablo
 
Posts: 23564
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Help with getting subtotal to show

Post by Pablo »

Is it even possible to cause the results of a code based calculation to be displayed in a form field?
Yes, of course that is possible.

You can get the element via JavaScript and set its value.
https://www.geeksforgeeks.org/set-the-v ... avascript/

But as mentioned, this is not specific to the software. Any code that works in standard HTML/JavaScript will also work in WWB.
User avatar
BaconFries
 
 
Posts: 5974
Joined: Thu Aug 16, 2007 7:32 pm

Re: Help with getting subtotal to show

Post by BaconFries »

Let me ask what I hope is a yes or no question. Is it even possible to cause the results of a code based calculation to be displayed in a form field?
Yes..if you look at the following on forms and conditions you will see it is possible. But for it to work it requires the logic behind it to work. If the logic is invalid or incorrect in anyway it will simply not work. So again to answer Yes it will work even with "Custom" code but it requires that you understand how to implement it first.
https://www.wysiwygwebbuilder.com/conditions.html
Here is a simple calculation example from codepen that uses form fields input a numerical value in each and the total is displayed in the last field..
https://codepen.io/jahangir6916753/pen/PoGQOWN
Just another example but this shows the total as text but it could also be easily displayed in a form field as well if needed.
https://codepen.io/prasanthmj/pen/pogWrXN
rongreen
 
 
Posts: 156
Joined: Thu Jun 06, 2024 4:36 pm

Re: Help with getting subtotal to show

Post by rongreen »

Thank you for all the suggestions. Resolution came via my son-in-law (programmer) who made a single change in the subtotal expression from Subtotal1.innerText to .value.
Post Reply