我找了两个小时了,谁能告诉我怎么找这个aspnetForm?????
function checkform()
{
var f= document.getElementById("aspnetForm");
if(trim(f.ctl00_ContentPlaceHolder1_textboxusername.value)=="")
{
alert ("请输入用户名");
f.ctl00_ContentPlaceHolder1_textboxusername.value="";
f.ctl00_ContentPlaceHolder1_textboxusername.focus();
return false;
}
else if(!checkusername(trim(f.ctl00_ContentPlaceHolder1_textboxusername.value)))
{
alert ("您输入的用户名的格式错误");
//f.ctl00_ContentPlaceHolder1_textboxusername.value="";
f.ctl00_ContentPlaceHolder1_textboxusername.focus();
return false;
}
if(trim(f.ctl00_ContentPlaceHolder1_TextBoxpassword1.value)=="")
{
alert ("密码不能为空!!!!!!!!!!!!!");
f.ctl00_ContentPlaceHolder1_TextBoxpassword1.focus();
return false;
}
if(f.ctl00_ContentPlaceHolder1_TextBoxpassword1.value!=f.ctl00_ContentPlaceHolder1_TextBoxpassword2.value)
{
alert ("两次输入密码不一致");
f.ctl00_ContentPlaceHolder1_TextBoxpassword1.value="";
f.ctl00_ContentPlaceHolder1_TextBoxpassword2.value="";
f.ctl00_ContentPlaceHolder1_TextBoxpassword1.focus();
return false;
}
if(trim(f.ctl00_ContentPlaceHolder1_TextBoxemail.value)=="")
{
alert ("请输入邮箱地址");
f.ctl00_ContentPlaceHolder1_TextBoxemail.value="";
f.ctl00_ContentPlaceHolder1_TextBoxemail.focus();
return false;
}
else if(!isemail(trim(f.ctl00_ContentPlaceHolder1_TextBoxemail.value)))
{
alert ("您输入的邮箱的格式错误");
//f.ctl00_ContentPlaceHolder1_textboxusername.value="";
f.ctl00_ContentPlaceHolder1_TextBoxemail.focus();
return false;
}
return true;
}
大家看这句:var f= document.getElementById("aspnetForm");
这里这个aspnetform我再整个项目中搜了5遍,没找到!!是系统定义的吗??
我下文有个form1,改了之后还不能用。
f.ctl00_ContentPlaceHolder1_TextBoxemail.focus();
还有这句,这其中的ctl00有是什么东西,也找不到,JS使用的是什么引用方法??
哪位能给我解释下??