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
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
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
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)
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
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
Could you please post a short example?
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
Sorry I don't understand.
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.