Hello everyone,
I'm trying to make text field #total show the calculated values of #debaters*30 and #vvs*25. So, a sum of 55 for one debater + one VVS (train ticket). Two debaters and one VVS would have to show 85 and so on.
Given that I already have a working JQ calculation in a CFv5 form, I wonder if there is a CFv6 issue I should know about when it comes to custom coding? JHint , a code-analysing webpage, can't find a mistake but it's also not fully designed to trace mistakes but just give opinions.
What is yours on these lines of programming?
Christopher
I'm trying to make text field #total show the calculated values of #debaters*30 and #vvs*25. So, a sum of 55 for one debater + one VVS (train ticket). Two debaters and one VVS would have to show 85 and so on.
Given that I already have a working JQ calculation in a CFv5 form, I wonder if there is a CFv6 issue I should know about when it comes to custom coding? JHint , a code-analysing webpage, can't find a mistake but it's also not fully designed to trace mistakes but just give opinions.
What is yours on these lines of programming?
jQuery(document).ready(function(jQ) {Thank you for any help and best regards,
jQ('#debaters,#vvs,#total').change(fees);
function fees() {
jQ('#total').val(jQ('#debaters').val() * 30 + jQ('#vvs').val() * 25);
}
});
Christopher
Hi Christopher,
The JavaScript looks OK. Are you loading this in a JavaScript element in your form?
Do you see any errors if you view the form page using the Web Developer tools in your browser.
Bob
The JavaScript looks OK. Are you loading this in a JavaScript element in your form?
Do you see any errors if you view the form page using the Web Developer tools in your browser.
Bob
Hello Bob,
that's the thing.. I can't find a JS element in CF6. I just used 'Custom code'?
that's the thing.. I can't find a JS element in CF6. I just used 'Custom code'?
Ohhhh, gotcha! It's in the designer tab, I only worked inside the setup area. I've added a JS element, and it is working already!
I guess that's different than in previous versions😛
Thanks for the hint!
Christopher
I guess that's different than in previous versions😛
Thanks for the hint!
Christopher
This topic is locked and no more replies can be posted.