你所说的this.*****中的'*****'指的是网页上各对象的名称。比如有一个<input type=text name=work-phone value="">,如果在网页上某个地方调用card("hblinux","beijing","010-22123222","010-23424233"),那么this.work-phone所得的值就是010-22123222,也就是在上面input里会显示这个值.

解决方案 »

  1.   

    文本框的属性也可以设置,不过你也可以写一个JAVASCRIPT或者VBScript来判断是否数字。比如下面:
    <script language="VBscript">
     function checknum()
       str = document.work-phone.value
       isNum = true
       for i = 0 to len(str)-1
        str1=Mid(str,i,1)
        if (Asc(str1)<48) and (Asc(str1)>57) then
         isNum=false
        end if
       next
      if isNum then
        repsonse.write "全部数字"
      else
        response.write "带字符"
      end if
     end function
    </script>
    这是个临时编的一个,不知是不是完全正确,你可以先测试一下,有问题EMAIL:[email protected]
      

  2.   

    谢谢。不过,我只是以前粗略的了解了一下VBSCRIPT,我回去再仔细看看。我用JS写了一个,不知道对不对,请指点。<script language="javascript">
    function joke(){
    for(i=0;i<=document.form1.text1.value;i++)
      {
         window.alert("hello you fool!");
      }
    }  
    function check(){
       var level=new Array();
         level="abcdefghijklmn";//列出所有非数字的符号表
       var text=new Array();
         text=document.form1.text1.value;
    for(i=0;i<=text.length;i++)
      { 
        for(j=0;j<=level.length;j++) 
         {
          if(text[i]=level[j])
             window.alert("请输入数字!");
          else
            {text.abs();joke()};
          }
       }
     }</script>
      

  3.   

    hblinux老兄
    难道你不想试一下这个函数吗?
    IsNumeric()
      

  4.   

    我试了好象不行啊!
    <body>
    <form name="form1">
    <input type="text"name="text1"size="2"value="100">
    <input type="button" name="submit"value="输入完毕">
    </form>
    <script language="vbscript">
    sub submit_OnClick
    if IsNumeric(document.form1.text1.value)then
        if 
           document.form1.text1.value<100then
           msgbox"必须输入不小于100的数!请重新输入!"
        else
           msgbox"谢谢您的输入!
           document.form1.submit//???提交给谁?(调用JOKE()函数)  
        end if
    else
      msgbox"此非数字,请重新输入!"
    end if    
    end sub
    </script></body>
    代码怎么运行时提示"语法错误"?