my assignment is to make weight calculator but due to limitations of university I am not able to use all tags so I write code it works fine but gives me a error of please enter a valid value the two nearest valid value are ***number*** and ***number***.I think that is because of the number attribute in input tag but I can not able to find what's wrong and Как это исправить. < /p>
Есть еще одна ошибка, если я вычисляю только одну выходную вспышку на экране и исчез, если я получу вывод во всех полях, то ответ показан. PrettyPrint-Override ">
Weight Convertor Calculator
var z;
var x;
function converter() {
if (document.weight.kg.value >= 1) {
x = document.weight.kg.value;
document.getElementById("g").value = x * 1000;
document.getElementById("p").value = x * 2.2046;
document.getElementById("m").value = x * 1000000;
document.getElementById("ut").value = x * 0.0011023;
z = 35.274 * x;
document.getElementById("o").value = z;
} else {
window.alert("please enter any number greater than 0");
}
}
Weight Calculator
Enter your weight in Kg:[/b][b]
weight in Grams=[/b][b]
weight in Pounds=[/b][b]
weight in MilliGrams=[/b][b]
weight in US Ton=[/b][b]
weight in Ounces=[/b][b]
NOTE: Enter only numerical
value which is greater than 0[/b]
my assignment is to make weight calculator but due to limitations of university I am not able to use all tags so I write code it works fine but gives me a error of please enter a valid value the two nearest valid value are ***number*** and ***number***.[b]I think that is because of the number attribute in input tag but I can not able to find what's wrong and Как это исправить. < /p> Есть еще одна ошибка, если я вычисляю только одну выходную вспышку на экране и исчез, если я получу вывод во всех полях, то ответ показан. PrettyPrint-Override ">[code]
Weight Convertor Calculator
var z; var x;
function converter() { if (document.weight.kg.value >= 1) { x = document.weight.kg.value; document.getElementById("g").value = x * 1000; document.getElementById("p").value = x * 2.2046; document.getElementById("m").value = x * 1000000; document.getElementById("ut").value = x * 0.0011023; z = 35.274 * x; document.getElementById("o").value = z;
} else { window.alert("please enter any number greater than 0"); } }
Weight Calculator
Enter your weight in Kg:[/b][b]
weight in Grams=[/b][b]
weight in Pounds=[/b][b]
weight in MilliGrams=[/b][b]
weight in US Ton=[/b][b]
weight in Ounces=[/b][b]
NOTE: Enter only numerical value which is greater than 0[/b]