| 
	
	
		
		
			
			 
				Что сделал не так?
			 
			
		
		
		
		Проверка формы почему то не работает 
 
<html> 
<head> 
<script type="text/javascript"> 
	   function checkForm()  
	   { 
          var login = document.getElementById("login"); 
		  var password = document.getElementById("password"); 
		  var passwordConfirm = document.getElementById("passwordConfirm"); 
		   
		  if (!login.value) 
		  { 
		    alert("Пустой логин!"); 
			return false; 
		  } 
 
          if (password.value.length < 6) 
		  { 
		    password.value = passwordConfirm.value = ""; 
		    alert("Пароль короче 6 символов!") 
		    return false; 
		  } 
	      if (password.value. != passwordConfirm.value) 
		  { 
		    password.value = passwordConfirm.value = ""; 
		    alert("Пароли не совпадают!") 
		    return false; 
		  } 
	   } 
	   window.onload = function () 
	   { 
	      var form = document.getElementById("myForm") 
		  form.onsubmit = checkForm 
	   } 
 
</script> 
</head> 
<body> 
<form id="myForm"> 
	<p >Форма регистрации</p> 
	<table> 
	<tr> 
	<p> 
		<th><label  >Логин:</label></th> 
		<td><input type="text" name="login" id="login"/><td> 
	</p> 
	</tr> 
	 
	 
	 
 
	 
	<tr> 
	<p> 
	 
		<th><label >Пароль:</label></th> 
		<td><input type="password" name="password" id="password" /></td> 
	</p> 
	</tr> 
	 
	<tr> 
	<p> 
	 
		<th><label  >Повторите пароль:</label></th> 
		<td><input type="passwordConfirm" name="passwordConfirm" id="passwordConfirm"/></td> 
	</p> 
	</tr> 
		 
	 
	<td> 
    <p><input  type="submit"/> 
	</td> 
      
	</table> 
</form> 
</body> 
</html> 
		
	
		
		
		
		
		
		
	
		
			
			
	
			
			
			
			
			
			
			
			
			
			
				
			
			
			
		 
		
	
	
	 |