javascript で If 条件を 1 つ使用しています。
var iid = "c_poqty_"+itemid;
var calculatedQuantity = document.getElementById(iid).value;
if(! isNaN(actualQuantity)) {
if(actualQuantity >= calculatedQuantity) {
return true;
} else {
alert("You must enter the order qty same or greater than the calculated PO Qty");
document.getElementById(iid).focus();
return false;
}
} else {
alert("Please Enter valid number");
document.getElementById(iid).focus();
return false;
}
ここでcalculatedQuantity
は、常に float で、whileactualQuantity
は整数にすることができます。テストケースが 1 つあります。
calculatedQuantity = 1.0
actualQuantity = 1
あなたの助けに感謝します!