var e =/^\d{10}|\d{12}$/; if (e.test(document.formreg.inn.value)==0) alert("Введите корректный ИНН!");