用javascript实现用户登录验证
1 <script language=javascript> 2 function checkSubmit() 3 { 4 if ((document.form1.name.value)=="") 5 { 6 window.alert ('姓名必须填写'); 7 document.form1.name.select(); 8 document.form1.name.focus(); 9 return false; 10 } 11 else 12 return true; 13 } 14 </script> 15 <form name=”form1″ onsubmit=”javascript:return checkSubmit()”> 16 <input type=”text” name=”name”> 17 </form>