Hello,
I try to make a form with this JS code found in your forum.
I put it in a load 'JS event' before the event 'HTML render form'.
Nothing happens.
Any ideas ?
I try to make a form with this JS code found in your forum.
window.addEvent('domready', function() {
$('prixrouge').addEvent('keyup', calc);
$('qterouge').addEvent('keyup', calc);
});
function calc() {
var price = $('prixrouge').value;
var quantity = $('qterouge').value;
if ( price > 0 && quantity > 0 ) {
$('total_rouge').value = $price * $quantity;
}
});
I put it in a load 'JS event' before the event 'HTML render form'.
Nothing happens.
Any ideas ?
Hi alec6w,
The JavaScript looks OK, impossible to say anything else without looking at the form. Do you see any errors in the JavaScript console in your browser web developer tools?
Bob
The JavaScript looks OK, impossible to say anything else without looking at the form. Do you see any errors in the JavaScript console in your browser web developer tools?
Bob
Thanks for you quick reply.
Your answer help me.
There was some errors in my JS code.
Here the correct code.
Your answer help me.
There was some errors in my JS code.
Here the correct code.
window.addEvent('domready', function() {
$('prixrouge').addEvent('keyup', calc);
$('qterouge').addEvent('keyup', calc);
});
function calc() {
var price = $('prixrouge').value;
var quantity = $('qterouge').value;
if ( price > 0 && quantity > 0 ) {
$('totalrouge').value = price * quantity;
}
}
This topic is locked and no more replies can be posted.