I use one If condition in javascript,
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; }
Here calculatedQuantity always in the float and while actualQuantity can be an integer, I have one test file:
calculatedQuantity = 1.0 actualQuantity = 1
Appreciate your help!
source share