show code
<?php
if (isset($_POST['childid'])){
echo $_POST['childid'];
die();
}
?>
<div id="sgwaitingmsg"></div>
<input id="childsgselect" value="hellllo" />
<script>
function viewsg(){
document.getElementById('sgwaitingmsg').innerHTML = "Just a second...";
var childid = encodeURIComponent(document.getElementById('childsgselect').value);
var parameters ='childid=' + childid;
var params ='childid=' + childid;
http=new XMLHttpRequest();
http.open('POST', '<?php echo $_SERVER['PHP_SELF']; ?>', true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.send(parameters);
//alert(parameters);
http.onreadystatechange = function(){
if (http.readyState==4)
{
document.getElementById("sgwaitingmsg").innerHTML=http.responseText;
}
}
}
viewsg();
</script>