asp.net服务器控件调用javascript的问题
我在客户端写了一个用户注册所需的js的验证的脚本,如下:
<script language=javascript>
function checkInfo()
{
var uname = document.getElementById( "txtusername ").value;
var rname = document.getElementById( "txtrname ").value;
var email = document.getElementById( "txtemail ").value;
var cid = document.getElementById( "txtcid ").value;
var mb = document.getElementById( "txtmb ").value;
var ph = document.getElementById( "txtpth ").value;
var add = document.getElementById( "txtadd ").value;
var post = document.getElementById( "txtpost ").value;
if(uname == " ")
{
alert( '请输入用户名! ');
return false;
}
else if(rname == " ")
{
alert( '请输入真实姓名! ');
return false;
}
else if(email == " ")
{
alert( '请输入Email! ');
return false;
}
else
{
var reg=/^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
if(!reg.test(email))
{
alert( "电子邮件填写错误! ");
return false;
}
}
if(cid == " ")
{
alert( "请输入身份证号码! ");
return false;
}
else
{
if (isNaN(cid))
&nbs