var s = parseFloat(txtTotal.value, 10);
if (isNaN(s) || txtTotal.value == 0) {
fncAlert("Please enter amount greater than 0");
return false;
}
以上代码始终是RETURNING S AS NaN。任何帮助?
答案 0 :(得分:1)
您的代码应如下所示,因为您在 txtTotal 中获取价值 变量
首先删除toUpperCase()
,然后使用:
var txtTotal = $("#txtNet").val();
var s = parseFloat(txtTotal, 10);
if (isNaN(s) || txtTotal == 0) {
fncAlert("Please enter amount greater than 0");
return false;
}