<form name="form" action="" onSubmit="return Check(form)">
你肯定漏了return

解决方案 »

  1.   

    temp是数字还是字符,在上面怎么又是字符又是数字??
      

  2.   

    <script language="jscript">
    <!--
    function Check(form)
    {
       var NotNull;
       var temp;
       var tempSub;
       NotNull=true;   
     temp=form.MediaPortFrom.value;  //是否是数字?
       if(temp>65535||temp<0)
       {
           window.alert("ok!");
       NotNull=false;
    }//如果是数字temp=String(temp);
    for(i=0;i<temp.length;i++){
            tempSub=temp.substring(i,i+1);
        if(tempSub>=0&&tempSub<=9){}
    else{
             window.alert("ok!");
         NotNull=false;
     break;
         }
       }
         return  NotNull
    }
    //-->
    </script>
      

  3.   

    再后面要把temp变成字符,因为substring是字符的方法。
      

  4.   

    temp=form.MediaPortFrom.value;  //是否是数字?
    应该使用 parseInt 
     temp=parseInt(form.MediaPortFrom.value);  //是否是数字?
    强行保证数据类型