点滴积累,融会贯通

-----喜欢一切有兴趣的东西

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

  function cTrim(sInputString,iType)
             {
    var sTmpStr = ' '
    var i = -1
    if(iType == 0 || iType == 1)
    {
     while(sTmpStr == ' ')
     {
      ++i
      sTmpStr = sInputString.substr(i,1)
     }
     sInputString = sInputString.substring(i)
    }
    if(iType == 0 || iType == 2)
    {
     sTmpStr = ' '
     i = sInputString.length
     while(sTmpStr == ' ')
     {
      --i
      sTmpStr = sInputString.substr(i,1)
     }
     sInputString = sInputString.substring(0,i+1)
    }
    return sInputString;
             }


if (isNaN(docform.txtFaultFirstEliminateTimes.value)==true || cTrim(docform.txtFaultFirstEliminateTimes.value,0)=="")

{

alert("只能是数字");
 

return ;

}

posted on 2006-02-08 17:24  小寒  阅读(840)  评论(0编辑  收藏  举报