INPUT de username
Código HTML:
<input type="text" autocomplete="off" name="username" maxlength="20" class="form-content-big-input" onblur="if(validUser()=='0'){ this.style.border='1px solid red'; }else{ this.style.border='1px solid #093'; }" />
Código Javascript:
Ver original
function validUser(){ var act = new Date(); http[act] = createRequestObject(); http[act].open('post', '/inc/is_valid.php',true); http[act].onreadystatechange = function() { if (http[act].readyState == 4) { if (http[act].status == 200 || http[act].status == 304) { reponsevalue=http[act].responseText; } } } http[act].setRequestHeader('Content-Type','application/x-www-form-urlencoded'); http[act].send("user=" + document.forms['new-user'].elements['username'].value); return reponsevalue; }