var xmlhttp_lost_passwd = false; try {xmlhttp_lost_passwd = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp_lost_passwd = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp_lost_passwd = false; } } if (!xmlhttp_lost_passwd && typeof XMLHttpRequest != 'undefined') { xmlhttp_lost_passwd = new XMLHttpRequest(); } function ckLostPassword(){ var regex_email=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; if(!regex_email.test(document.getElementById("txtUsername").value)){ alert("Periksa format email anda"); return false; } // alert('http://jogjamarket.com/do-lost-password/get-my-passwd.html'); xmlhttp_lost_passwd.open('POST','http://jogjamarket.com/do-lost-password/get-my-passwd.html'); xmlhttp_lost_passwd.onreadystatechange = function() { if ( xmlhttp_lost_passwd.readyState == 4 && xmlhttp_lost_passwd.status == 200 ) { document.getElementById("msg_lost").innerHTML = xmlhttp_lost_passwd.responseText; document.getElementById("loader_lost").innerHTML= ""; } else { document.getElementById("loader_lost").innerHTML = ' checking..'; } }; var poststr ='email=' + encodeURI(document.getElementById('txtUsername').value); xmlhttp_lost_passwd.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xmlhttp_lost_passwd.setRequestHeader('Content-length', poststr.length); xmlhttp_lost_passwd.setRequestHeader('Connection', 'close'); xmlhttp_lost_passwd.send(poststr); return false; }