就是一些 email检查,密码长度什么的
还有就是一个文本框失去焦点是什么触发事件?
------解决方案--------------------
<script language=javascripte>
function checkadd()
{
if(checkspace(document.thisform.title.value)) {
document.thisform.title.focus();
alert( "对不起,请填写留言标题! ");
return false;
}
if(checkspace(document.thisform.name.value)) {
document.thisform.name.focus();
alert( "对不起,你的名称! ");
return false;
}
if(document.thisform.email.value.length!=0)
{
if (document.thisform.email.value.charAt(0)== ". " ||
document.thisform.email.value.charAt(0)== "@ "||
document.thisform.email.value.indexOf( '@ ', 0) == -1 ||
document.thisform.email.value.indexOf( '. ', 0) == -1 ||
document.thisform.email.value.lastIndexOf( "@ ")==document.thisform.email.value.length-1 ||
document.thisform.email.value.lastIndexOf( ". ")==document.thisform.email.value.length-1)
{
alert( "Email地址格式不正确! ");
document.thisform.email.focus();
return false;
}
}
else
{
alert( "Email不能为空! ");
document.thisform.email.focus();
return false;
}
if(checkspace(document.thisform.words.value)) {
document.thisform.words.focus();
alert( "对不起,请填写留言内容! ");
return false;
}
}
function checkspace(checkstr) {
var str = ' ';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
</scripte>