jQuery code .val(); not working in FF
Posted
by
SzamDev
on Stack Overflow
See other posts from Stack Overflow
or by SzamDev
Published on 2010-12-30T22:25:34Z
Indexed on
2010/12/30
22:53 UTC
Read the original article
Hit count: 117
JavaScript
|jQuery
Hi
I have this code
function calculateTotal() {
var total = 0;
$(".quantity").each(function()
{
if (!isNaN(this.value) && this.value.length != 0)
{
total += parseFloat(this.value);
}
});
$("#total_quantity").val(total);
}
<input onchange="calculateTotal();" name="sol1" type="text" class="result_form_textbox_small quantity" id="sol1" />
<input name="total_quantity" type="text" class="result_form_textbox_small" id="total_quantity" />
This code is working in IE very good but it's not working in FF.
What is the proplem?
Thanks in advance.
© Stack Overflow or respective owner