--------------------------------------- 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.
var msg="";
还是用你自己的var msg;
msg="";?????
重复了吧 而且你的函数中的变量根本就没有用,而且你在使用onsubmit时函数的变量是什么东西没有定义 form1->"form1"或许就可以了
你的函数中的Form1是没有用的,建议你去掉,也就是说你的那个传递的变量也就没有用了 那我上面不是白说了么:(
改为:
<form method="post" name="form1" action="test.asp" onsubmit="return checkreg(this.name);" >
用document.form1或者调用时用checkreg(this)function checkreg(obj)
{
alert(obj.tagName);
}
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.