function isInt (s)
{
var re = /^\d{1,3}$/;
return re.test(s);
}

解决方案 »

  1.   

    function isTime(s)
    {
        var re = /^\d{4}\-\d{1,2}\-\d{1,2}$/;
    return re.test(s.toString());
    }
      

  2.   

    问题又来,还得请教:GageCSDN(稻草人--http://www.sms-web.net) function isInt (s)
    {
    var re = /^\d$/;
    return re.test(s);
    }
    我怎么严整s为0~9的字符穿呢?不用限制数字的个数
      

  3.   

    还有一个小问题:
    怎样获得下拉框<select>包含的<option>个数呢?<select name="cboTest">
    <option value="1">礼品</option>
             <option value="2">手机</option></select>
      

  4.   


       问题又来,还得请教:GageCSDN(稻草人--http://www.sms-web.net) function isInt (s)
    {
    var re = /^\d$/;
    return re.test(s);
    }
    我怎么严整s为0~9的字符穿呢?不用限制数字的个数
      
    怎样获得下拉框<select>包含的<option>个数呢?<select name="cboTest">
    <option value="1">礼品</option>
             <option value="2">手机</option></select>
      
     
    Top  
     
      

  5.   

    我怎么严整s为0~9的字符穿呢?不用限制数字的个数
    ============>
    function isInt (s)
    {
    var re = /^\d+$/;
    return re.test(s);
    }怎样获得下拉框<select>包含的<option>个数呢?
    ================>
    alert(document.getElementsByName('cboTest')[0].options.length);
      

  6.   

    这种问题,用vbs的isdate(),isnumric()多爽呀:)