Lobezki,
<input type="text" id="input1" value="" maxlength="8">
<input type="text" id="input2" value="" maxlength="8">
<script>
var x = document.getElementById('input1');
var y = document.getElementById('input2');
x.focus();
x.onkeyup = x.onpaste = y.onkeyup = y.onpaste = function(){
var z = this;
setTimeout(function(){
z.value = z.value.replace(/[^\d]/g, '');
if (z.value.length == 8) {
y.focus();
// AJAX запрос
}
}, 0);
};
</script>