把checkreg(form1)的form1去掉如:checkreg()函数的夜去掉试一下:-)

解决方案 »

  1.   

    sorry,没看清
    var msg="";
    还是用你自己的var msg;
      

  2.   

    var msg="";
    msg="";?????
    重复了吧 而且你的函数中的变量根本就没有用,而且你在使用onsubmit时函数的变量是什么东西没有定义 form1->"form1"或许就可以了
    你的函数中的Form1是没有用的,建议你去掉,也就是说你的那个传递的变量也就没有用了 那我上面不是白说了么:(
      

  3.   

    <form method="post" name="form1" action="test.asp" onsubmit="return checkreg(form1);" >
    改为:
    <form method="post" name="form1" action="test.asp" onsubmit="return checkreg(this.name);" >
      

  4.   

    把参数去掉
    用document.form1或者调用时用checkreg(this)function checkreg(obj)
    {
       alert(obj.tagName);
    }
      

  5.   

    ---------------------------------------
    pername=form1.name.value;
    ---------------------------------------Notice here, I guess name(form field, maybe person name^_^) is a control of form1, but the control's name is same with one of the FORM control's property.Maybe there's other mistakes in your code, I only found this one.