<script> var n = '<div&glt111</div&glt assa'; function nn(n){ if(/^\s*$/.test(n)){ alert("all null") }else{ alert("not all null") } } var n1=" " nn(n); nn(n1); </script>
<SCRIPT language=JavaScript> function register_submit() { function IsDigit(cCheck) { return (('0'<=cCheck) && (cCheck<='9')); } function IsAlpha(cCheck) { return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z'))) }
var n = '<div&glt111</div&glt assa';
function nn(n){
if(/^\s*$/.test(n)){
alert("all null")
}else{
alert("not all null")
}
}
var n1=" "
nn(n);
nn(n1);
</script>
function register_submit()
{
function IsDigit(cCheck) { return (('0'<=cCheck) && (cCheck<='9')); }
function IsAlpha(cCheck) { return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z'))) }
username = document.form1.username.value;
if (username== "")
{
alert("请输入您的用户名");
document.form1.username.focus();
return false;
}
for (nIndex=0; nIndex<username.length; nIndex++)
{
cCheck = username.charAt(nIndex);
if ( nIndex==0 && ( cCheck =='-' || cCheck =='_') )
{
alert("用户名首字符必须为字母或数字");
document.form1.username.focus();
return false;
}
if (!(IsDigit(cCheck) || IsAlpha(cCheck) || cCheck=='-' || cCheck=='_' ))
{
alert("用户名只能使用英文字母、数字以及-和_,并且首字符必须为字母或数字");
document.form1.username.focus();
return false;
}
} </SCRIPT>