РЕДАКТИРОВАТЬ: обновленный ответ:
вы просто отбрасываете все не не числа, а затем проверяете, не является ли число 0 ТО, и вы можете выполнять свою функцию.
a.onchange=b.onchange=a.onkeyup=b.onkeyup= function() {
// 1. First we will remove all non numbers from the values inputted by the user.
var aValue = new String(a.value);
var bValue = new String(b.value);
//Use regular expressions to strip out the non numbers incase the user types in non numbers.
aValue = aValue.replace(/[^0-9]/g, '');
bValue = bValue.replace(/[^0-9]/g, '');
float newAValue = parseFloat("aValue");
float newBValue = parseFloat("bValue");
//2. Then test to see if the user has typed 0 as the value if they haven't then you an perform the maths.
if((newAValue != 0) && (newBValue != 0))
c.value= Math.ceil((av/bv)*100);
};
Надеюсь, это поможет.Спасибо Дайте мне знать, если это так.
PK