У меня есть следующий код:
<script>
function pesquisa_cid_01() {
var oHTTPRequest = createXMLHTTP();
oHTTPRequest.open("post", "bd_ajax_ciat_cid.asp", true);
oHTTPRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
oHTTPRequest.onreadystatechange=function() {
if (oHTTPRequest.readyState == 4) {
document.all.div_pesquisa_cid_01.innerHTML = oHTTPRequest.responseText;
}
}
oHTTPRequest.send("busca_cid_01=" + encodeURIComponent(form_ciat_new.pesquisa_cid_01_form.value));
}
</script>
Как заставить принудительно начать работу кода только с 2 и более символами, введенными при вводе формы?
Код формы:
<input type="text" name="pesquisa_cid_01_form" id="pesquisa_cid_01_form" class="form-control" onkeyup="pesquisa_cid_01();">