Dear all,
In CF V6, I'm trying to do a little calculation and show the result in a field ID called 'total'. The number of females and the numbers of males at an event times a price (84.00) add up to a sum total. Since the numbers are limited, they are selected from a dropdown. I somehow suspect that's the issue but can't tell why. The IDs are double-checked and so are values.
The code is as follows:[pre]jQuery(document).ready(function(){
[br] jQ('#_of_female_debaters').change(calculate);[br] jQ('#_of_male_debaters').change(calculate);[br][br]function calculate(e)[br]{[br] jQ('#total').html(jQ('#_of_female_debaters').val() * 84 + jQ('#_of_male_debaters').val() * 84);[br]}[br]});[/pre]
I have tried two online jQuery editors and checks, and they all confirm the correctness of the code. However, it is not working in my form. The total text field stays empty.


What does the 'Add inside Domready' tickbox mean? It doesn't seem to make a difference, but it may be connected.
Many thanks for the help![br]Chris
In CF V6, I'm trying to do a little calculation and show the result in a field ID called 'total'. The number of females and the numbers of males at an event times a price (84.00) add up to a sum total. Since the numbers are limited, they are selected from a dropdown. I somehow suspect that's the issue but can't tell why. The IDs are double-checked and so are values.
The code is as follows:[pre]jQuery(document).ready(function(){
[br] jQ('#_of_female_debaters').change(calculate);[br] jQ('#_of_male_debaters').change(calculate);[br][br]function calculate(e)[br]{[br] jQ('#total').html(jQ('#_of_female_debaters').val() * 84 + jQ('#_of_male_debaters').val() * 84);[br]}[br]});[/pre]
I have tried two online jQuery editors and checks, and they all confirm the correctness of the code. However, it is not working in my form. The total text field stays empty.


What does the 'Add inside Domready' tickbox mean? It doesn't seem to make a difference, but it may be connected.
Many thanks for the help![br]Chris