<script language="javascript"> function checkNull001() { if (document.getElementById("<%=txtName.ClientID %>").value == "") { alert("请输入用户名!"); document.getElementById("<%=txtName.ClientID %>").focus(); return false; } if (document.getElementById("<%=txtpsw.ClientID %>").value == "") { alert("请输入密码!"); document.getElementById("<%=txtpsw.ClientID %>").focus(); return false; } } </script>