<input type="text" ... onkeyup="if(this.value.length>7) this.form.submit()">

Natualmente il 7 puoi cambiarlo con il numero che vuoi