| 
	
	
		
		
			
			 
				Проверка на наличие определенных символов
			 
			
		
		
		
		проверка почемуто не коректно работает, не могу розобраться почему. Помогите пожалуйста! 
 
<html> 
<head> 
<script language="JavaScript"> 
<!-- hide 
 
function check(input) { 
  var ok = true; 
 
  for (var i = 0; i < input.length; i++) { 
    var chr = input.charAt(i); 
    var found = false; 
    for (var j = 1; j < check.length; j++) { 
      if (chr == check[j]) found = true; 
    } 
    if (!found) ok = false; 
  } 
  
  return ok; 
} 
 
function test(input) { 
 
  if (!check(input, "1", "2", "3", "4", 
        "5", "6", "7", "8", "9", "0", "/", "-", " ")) { 
 
    alert("Input not ok."); 
  } 
  else { 
    alert("Input ok!"); 
  } 
} 
 
// --> 
</script> 
</head> 
 
<body> 
<form> 
Telephone: 
<input type="text" name="telephone" value=""> 
<input type="button" value="Check" 
  onClick="test(this.form.telephone.value)">  
</form> 
</body> 
</html> 
		
	
		
		
		
		
		
		
	
		
		
	
	
	 |