function checkNumber(obj){
temValue=obj.value;
check=isNaN(temValue)
if (check){
alert("请输入数字!")
obj.select()
obj.focus();
}
else{
obj.blur();
}
}
temValue=obj.value;
check=isNaN(temValue)
if (check){
alert("请输入数字!")
obj.select()
obj.focus();
}
else{
obj.blur();
}
}
temValue=obj.value;
check=isNaN(temValue)
if (check){
alert("请输入数字!")
obj.select()
obj.focus();
}
else{
obj.blur();
}
}
if (document.Goods.InPrice.value==0 ||document.Goods.InPrice.value=="0") {
alert("请填写进货价格!");
document.Goods.InPrice.focus();
return;
}我要在上面的函数加上价格必须为数字的判断,怎么做呢?马上结帖,不够再加!
{
var c;
for(var i=0; i<value.length; i++)
{
c = value.charAt(i);
if("0123456789".indexOf(c,0) < 0)
{
alert("请填写正确的进货价格!“);
}
}
}
CheckNUM(document.Goods.InPrice.value)
if (document.Goods.InPrice.value==0 ||document.Goods.InPrice.value=="0") {
alert("请填写进货价格!");
document.Goods.InPrice.focus();
return;
}
if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)||(event.keyCode==8)))
alert("必须添入数字!");
}
if (!document.Goods.InPrice.value.match(/^\d+$/)) {
alert("请正确填写进货价格!");
document.Goods.InPrice.focus();
return;
}