By the time the script is executing, the values of #txtqty1 and #txtqty2 will be just empty strings (unless you provided a default value in the markup). To run that check when the user actually entered some values, you’ll have to add event listeners to do so:
var txtqty1 = document.getElementById('txtqty1')
var txtqty2 = document.getElementById('txtqty1')
var validateInput = function () {
var qty1 = parseFloat(txtqty1).value
var qty2 = parseFloat(txtqty2).value
// etc.
}
txtqty1.addEventListener('change', validateInput)
txtqty2.addEventListener('change', validateInput)
PS: If you’re planning to keep those alerts, you might just add an event listener to a submit button or something – otherwise the constant modal messages would be rather annoying.