不知道这样是否可以Dim Str, StrLen, MaxMax=8
Str="12"
StrLen=Len(Str)For i=1 to Max-StrLen
  Str = "0" & Str
Next

解决方案 »

  1.   

    textbox.value=("00000000" + textbox.value).replace(/^.+(.{3})$/, "$1");
      

  2.   

    textbox.value=("00000000" + textbox.value).substr(textbox.value.length);
      

  3.   

    <script language="vbscript">
    function bc()
    Dim Str, StrLen, Max
    str=document.frm.test.value
    if isnumeric(str)=false and str<>"" then
    msgbox("请输入数字")
    document.frm.test.focus()
    document.frm.test.select()
    exit function
    end ifStrLen=Len(str)For i=1 to 8-StrLen
      Str = "0" & Str
    Next
    document.frm.test.value=str
    end function
    </script><form name=frm>
    <input name=test maxlength=8 onblur="vbscript:bc()">
    </form>