Am I missing something with the widget calculator settings? I've followed the tutorial in the FAQ's section (Creating a calculation form in Chronoforms6). Added two text fields - field1 and field2 and for some reason can't get the calculator to show the total.



I can see in the inspector that the "total" value is changing when I make a change in the form but the "widget_calculator_value" does not
Am I missing a step?
Thanks,
Matt
Joomla 3.8.11
CFV6



I can see in the inspector that the "total" value is changing when I make a change in the form but the "widget_calculator_value" does not
Am I missing a step?
Thanks,
Matt
Joomla 3.8.11
CFV6
Hi Matt,
Please try replacing #total with #widget_calculator_value if that is the id of the element you are using to show the result.
Bob
Please try replacing #total with #widget_calculator_value if that is the id of the element you are using to show the result.
Bob
Still no change...



Here is a link to the frontend -
http://coupons.cuttingcoupons.net/index.php?option=com_chronoforms6&chronoform=simplecalculator
Thanks,
Matt



Here is a link to the frontend -
http://coupons.cuttingcoupons.net/index.php?option=com_chronoforms6&chronoform=simplecalculator
Thanks,
Matt
Hi Matt,
Your 'widget_calculator_value' element is a span, not a hidden input and so doesn't have a 'value'. You need to change the text in the span if you want to use that - or syou could use a readonly input instead.
Bob
Your 'widget_calculator_value' element is a span, not a hidden input and so doesn't have a 'value'. You need to change the text in the span if you want to use that - or syou could use a readonly input instead.
Bob
Hi Bob,
Thanks for the help but now I'm more confused than before... Is this a setting in the widget calculator or in javascript or a completely unrelated area that I need an additional field for?
The example that you showed in the FAQs section seemed pretty straight forward, I guess I'm just not versed enough to understand what I'm missing
I'm basically trying to replicate the calculator that you show in the FAQ section to understand how it works before I build my form and do more complex calculations
Thanks,
Matt
Thanks for the help but now I'm more confused than before... Is this a setting in the widget calculator or in javascript or a completely unrelated area that I need an additional field for?
The example that you showed in the FAQs section seemed pretty straight forward, I guess I'm just not versed enough to understand what I'm missing
I'm basically trying to replicate the calculator that you show in the FAQ section to understand how it works before I build my form and do more complex calculations
Thanks,
Matt
The element you have ID'd as widget_calculator_value is a <span> - spans don't have a value, you can't use .val()
In your provided code, you should use jQuery("#total").val(blahblahblah)
In your provided code, you should use jQuery("#total").val(blahblahblah)
Still confused... You're saying I can't use .val() but then want me to use jQuery("#total").val(blahblahblah) - isn't that using .val() or are you saying I can use it for the hidden field "total" but not the "widget_calculator_value" field?
So, here is the latest version of what I put in for the code:

this is what I get:

The "total" value is adding up correctly when I change the two fields. I understand that it is a span but I don't understand how to get the "total" value to show where the "widget_calculator_value" is. I believe this field is generated by the chronoforms calculator widget itself from the "Widget ID" correct?
Thank you guys for your help
Matt
So, here is the latest version of what I put in for the code:
$("#field1,#field2").on("change", function(){this is my calculator widget:
jQuery("#total").val(parseInt($("#field1").val()) + parseInt($("#field2").val()));
});

this is what I get:

The "total" value is adding up correctly when I change the two fields. I understand that it is a span but I don't understand how to get the "total" value to show where the "widget_calculator_value" is. I believe this field is generated by the chronoforms calculator widget itself from the "Widget ID" correct?
Thank you guys for your help
Matt
OK so the way that widget works is under the events tab for the field that holds the value you want to add to the total, you use an add to / subtract from / multiply with action, with the hidden total field as the "Element(s) identifier".
No additional javascript needed, unless you want to use anot
her hidden field to put a custom calculated value into, and have the onchange of that update the total as well.
No additional javascript needed, unless you want to use anot

Oh ok, now I get it... I had a feeling I was over-complicating things. I will need to use the additional javascript for other fields since more complex calculations for various scenarios will be needed, but now I understand how I can do that. It's been a couple of years since I've used Chronoforms and things have changed quite a bit (in a good way).
Thanks for your help on this
Matt
Thanks for your help on this
Matt
I am searching for a simple solution to calculate prices for different variations of a single product:
I used the demo of dynamic dropdown to create a form:

The dropdown "Lattenquerschnitt" has tree options (every option has a single price)
The dropdown "Lattenfarbe" has no influence on the pricing but is dependend on Lattenquerschnitt (this works perfectly fine).
The dropdown "Lattenlänge" has four options. My problem is that every option of Lattenquerschnitt has a different price in every length (Lattenlänge").
The textfield "Text label" was foreseen to just show the price per unit.
I tried the calculator widget but i do not have a clue where to "store" the prices of every variable!!!
Can you please help!
I used the demo of dynamic dropdown to create a form:
The dropdown "Lattenquerschnitt" has tree options (every option has a single price)
The dropdown "Lattenfarbe" has no influence on the pricing but is dependend on Lattenquerschnitt (this works perfectly fine).
The dropdown "Lattenlänge" has four options. My problem is that every option of Lattenquerschnitt has a different price in every length (Lattenlänge").
The textfield "Text label" was foreseen to just show the price per unit.
I tried the calculator widget but i do not have a clue where to "store" the prices of every variable!!!
Can you please help!
You can store the price of every variable as the values of Lattenquerschnitt or whatever. You can build those price values in your reload event
look at the dynamic dropdown demo.
The value of "Lattenfarbe" is built in the reload event, but i need to store 2 values: Lattenquerschnitt and Lattenlaenge.
https://www.c-mueller.biz/index.php?option=com_chronoforms6&chronoform=test
https://www.c-mueller.biz/index.php?option=com_chronoforms6&chronoform=test
Sorry I don't understand.
I am sorry. I posted a link to the form that you can see and use the form but this was the link to the administration area. Now I corrected the link:
https://www.c-mueller.biz/index.php?option=com_chronoforms6&chronoform=test
Moreover I attached some pictures to explain the way the form is designed.



I do not have a clue where I can store the different prices for different Lattenlaenge and Lattenfarbe!!!
https://www.c-mueller.biz/index.php?option=com_chronoforms6&chronoform=test
Moreover I attached some pictures to explain the way the form is designed.
I do not have a clue where I can store the different prices for different Lattenlaenge and Lattenfarbe!!!
So you would build it in the reload event. Create an array of key/value pairs based on the option of the first drop down. The dynamic dropdown demo should show you everything you need to get started.
This topic is locked and no more replies can be posted.