Hi,
i'm trying to use JavaScript in order to calculate a fields value based on some other fields. After searching a while i found this code snippet:
So i slightly modified this to:
I've put this into the "On load" section in a "Load JavaScript" action after the form has been rendered (see attached photo)
My form itself has some sliders which contain some tabs. Once the above code is in place any link, either a click on a slider or a tab, seems to be broken an i get redirected to the index-page of my website. Once i remove the code again everything works as it should.
Does someone have an idea what i'm doing wrong?
I appreciate any help.
i'm trying to use JavaScript in order to calculate a fields value based on some other fields. After searching a while i found this code snippet:
window.addEvent('domready', function() {
// your script goes here
});
So i slightly modified this to:
window.addEvent('domready', function(){
$('nr_of_items').addEvent('change', berechnen);
});
function berechnen(){
$('sum').value = $('nr_of_items').value + 19;
}
I've put this into the "On load" section in a "Load JavaScript" action after the form has been rendered (see attached photo)
My form itself has some sliders which contain some tabs. Once the above code is in place any link, either a click on a slider or a tab, seems to be broken an i get redirected to the index-page of my website. Once i remove the code again everything works as it should.
Does someone have an idea what i'm doing wrong?
I appreciate any help.
Hi baraja,
This code is for v4, for v5 the code is a little bit different, it should be something like this:
Regards,
Max
This code is for v4, for v5 the code is a little bit different, it should be something like this:
jQuery(document).ready(function($){
$("#field_id").on("change", function(){
//code here
});
});
Regards,
Max
This topic is locked and no more replies can be posted.
