I have used ajax to display suggestions, when user enters alphabets in party name field.
while this code is running correctly on localhost, it is not working on zymic free host.
Any help is appreciated in advance!
the code is as follows:
var url1="getcustomer.php?param=";
if (window.XMLHttpRequest) {
http = new XMLHttpRequest();// i guess this is not working
} else if (window.ActiveXObject) {
http = new ActiveXObject("Microsoft.XMLHTTP");
}
function getcustomer() {
var idValue = document.getElementById("c_name").value;
var myRandom = parseInt(Math.random()*99999999); // cache buster
http.open("POST", url1 + escape(idValue) + "&rand=" + myRandom, true);
http.onreadystatechange = handleHttpResponse;
http.send(null);
}
function handleHttpResponse() {
if (http.readyState == 4) {
document.getElementById("hiddenDIV1")
.style.visibility="visible";
document.getElementById("hiddenDIV1")
.innerHTML=http.responseText;
document.getElementById('c_name').attachEvent('onkeydown',askproductKeyPress);
}
}
function loadrecord(record0,record1) {
document.orderform.c_name.value = record0;
document.getElementById("hiddenDIV1")
.style.visibility="hidden";
}