what I mean isif(document.board.username.value==""){ alert('请填写您的大名!'); document.board.username.focus(); return false;}or if(document.board.username.value.length==0){ alert('请填写您的大名!'); document.board.username.focus(); return false;}of course, you might consider to trim the string first to make sure they are not spacesWhat netying(鹰击长空) said is correct. You can also check Request.ServerVariables("HTTP_REFERER") to make sure the form data was posted from pages from your site, instead of someone else's
如果这样就可以提交空格字符了。
alert('请填写您的大名!');
document.board.username.focus();
return false;}or
if(document.board.username.value.length==0){
alert('请填写您的大名!');
document.board.username.focus();
return false;}of course, you might consider to trim the string first to make sure they are not spacesWhat netying(鹰击长空) said is correct. You can also check Request.ServerVariables("HTTP_REFERER") to make sure the form data was posted from pages from your site, instead of someone else's