没法全贴,还有很多jsp+ejb的东西.
我怀疑在做if (isNumeric(b))的时候,因为isNumeric会有return,则function presubmit()也同时return了???

解决方案 »

  1.   

    if (isNumeric(b))里的返回值只是if的条件,决定程序块的执行,造成你的问题的应该在if里的语句块里!
      

  2.   

    isNumeric () javascript了好象没有这个方法!!
      

  3.   

    function isNumeric(str){
    var i=0;
    var j=0;
    while(i<=str.length-1){
    str1=str.charAt(i);
    if (str1=='.'){
    if ((j>0)||(i==0)||(i==(str.length-1)))
    return false;
    j=j+1;
    }
    else if(isNaN(parseInt(str1))==true) return false;
    i=i+1;}
    return true;
    }
    function isinfanwei(str)
    {
    var newnum=www.split(".")
    if(newnum[0].length>3)
    {
    alert("The integer part length of the number:"+str+" is more than 3!");
    return false;
    }
    if(newnum[1].length>2)
    {
    alert("The decimal part length of the number:"+str+" is more than 2!");
    return false;
    }
    return true;
    }
    是我自己写的也在javascript里.
      

  4.   

    function isinfanwei(str)
    {
        var newnum=www.split(".")
        if(newnum[0].length>3)
        {
            alert("The integer part length of the number:"+str+" is more than 3!");
            return false;
        }
        if(newnum[1].length>2)
        {
            alert("The decimal part length of the number:"+str+" is more than 2!");
            return false;
        }
        return true;
    }
    这段程序有错,不知道错在哪里?
      

  5.   

    找到了    var newnum=www.split(".")
    应该是    var newnum=str.split(".")
      

  6.   

    如果str是整数,好象    var newnum=str.split(".") 就会出错误?