Сообщение от Quieteroks
|
AAAA00057
BBBB00210
ADNB34238
|
Вариант...
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<title></title>
</head>
<body>
<input name="test" id="test"/>
<script type="text/javascript">
$("#test").on("keyup blur", function () {
var str = $(this).val(), reg = "[A-Z] [A-Z] [A-Z] [A-Z] [0-9] [0-9] [0-9] [0-9] [0-9]".split(" "),
len = str.length > reg.length ? reg.length : str.length;
for (var a = 0; a < len && RegExp(reg[a]).test(str.charAt(a)); a++);
$(this).val(str.slice(0, a))
});
</script>
</body>
</html>