In CF7 I have 2 fields and I'm trying to populate a 3rd based on their values.
So on a new entry, the fields are all blank. When the user enters a value in the fields, I want a 3rd field to show the total.
On an existing entry, the fields will be populated with the saved values. When the user changes a value in the field, I want the total field to be updated.
I tried this with a Javascript function, but I must have messed it up somewhere. For the life of me I can't get anything to happen.
Here's my Javascript:

Here's the event setup I tried:



I think you need the events setup at the "Total" field only, and there should be one event with both fields because you have "if any matches"
if this does not work then I think you should just write a document ready event and listen for the 2 fields "input" event, I think you are comfortable writing javascript code
So I made this change and it doesn't appear to be working:

I wasn't sure if I was supposed to use Reload or not? (i did try adding a reload action, but it didn't seem to work)
I'll be honest, Javascript is new to me. If I write a Javascript function, do I remove this event?
Also, should I consider the Javascript field/action to be equivalent to <script> </script> so that I can then add anything and functions underneath?
Is there any way to troubleshoot to see what the Javascript is doing (I didn't see it in the debug).
Thanks!!!
please remove the brackets from the javascript function name at the last image, does it work ?
try to change "changes" to "input"
which v7 version do you have installed ?
Input doesn't work either :(.
Is there any way to test the java code? To see if the problem is the trigger, or if it is the code itself?
Version: 7.0.12
So I tried something for troubleshooting.
I created an alert box within the function. On load, and when changing field, no alert box is triggered.
I pulled the alert box outside of function but within same Javascript element. On load it's triggered, but when changing field, it is not.
Could there be some issue with the Call Function event?
I think I finally figured it out.
I moved the JavaScript element all the way down (below boxes) and turned "domready" to off.
I'm not familiar with JavaScript enough and when I read the description, I assumed I needed "domready" set to On.
Do I have it setup correct? When would I want to use "domready"?
I think with domready off is correct, the code checks for the function in the window and it may not work if the function is inside dom ready, I forgot about that
