交流,学习,进步!

千里之行始于足下……
  博客园  :: 首页  :: 联系 :: 订阅 订阅  :: 管理

js验证textbox输入的值

Posted on 2006-12-22 17:45  xixi8820  阅读(1084)  评论(0编辑  收藏  举报
function CheckQuery()

      if(BlankInBatchEdit.txtUNIT_PRICE.value == "") 
            {    
                  alert("请填写[单价]!"); 
                  BlankInBatchEdit.txtUNIT_PRICE.focus(); 
                  return false; 
            } 
     if(isNaN(BlankInBatchEdit.txtUNIT_PRICE.value)) 
            { 
                    alert("[单价]应该是数字!"); 
                    BlankInBatchEdit.txtUNIT_PRICE.focus();
                    return false;
             } 
       if(BlankInBatchEdit.txtUNIT_PRICE.value>=100000000) 
             { 
                     alert("[单价]超出范围!"); 
                     BlankInBatchEdit.txtUNIT_PRICE.focus(); 
                     return false; 
              } 
        if(BlankInBatchEdit.txtDESCRIPTION.value.length >200) 
              { 
                       alert("[描述]长度超出范围!");
                       BlankInBatchEdit.txtDESCRIPTION.focus(); 
                       return false; 
               }


///////////////////////////////////////////////////////
//客户端验证
    btns.btnSave.Attributes["onclick"] = "return CheckQuery();";