function checkNumber(obj){
    temValue=obj.value;
    check=isNaN(temValue)
    if (check){
alert("请输入数字!")
obj.select()
obj.focus();
    }
    else{
         obj.blur();
    }
}

解决方案 »

  1.   

    function checkNumber(obj){
        temValue=obj.value;
        check=isNaN(temValue)
        if (check){
    alert("请输入数字!")
    obj.select()
    obj.focus();
        }
        else{
             obj.blur();
        }
    }
      

  2.   

    function editSubmit(selid,Type) {
    if (document.Goods.InPrice.value==0 ||document.Goods.InPrice.value=="0") {
    alert("请填写进货价格!");
    document.Goods.InPrice.focus();
    return;
    }我要在上面的函数加上价格必须为数字的判断,怎么做呢?马上结帖,不够再加!
      

  3.   

    <input type=text name=txtPostalCode onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;">
      

  4.   

    function CheckNUM(value)
    {
     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)
      

  5.   

    function editSubmit(selid,Type) {
          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("必须添入数字!");
    }
      

  6.   

    function editSubmit(selid,Type) {
    if (!document.Goods.InPrice.value.match(/^\d+$/)) {
    alert("请正确填写进货价格!");
    document.Goods.InPrice.focus();
    return;
    }