GET SELECT TAG VALUE and strore php varible
<script>
function showUser(str) {
if (str == "") {
document.getElementById("txtHint").innerHTML = "";
return;
}
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET", "getuser.php?site=" + str, true);
xmlhttp.send();
}
</script>
........................................................................
$select_tag_value=?;
<div id="txtHint"></div>
....................................................................
getuser.php
.............................................................................
echo "<select name='company' onchange='showUser(this.value)'>";
while ($row = oci_fetch_assoc($stmt)) {
$company = $row['COMPANY_NAME'];
$company_id = $row['COMPANY_ID'];
echo ' <option value=' . $company_id . '>';
echo '<label>' . $company . '[' . $company_id . ']' . '</label>';
echo '</option>';
.
}
echo ' </select>';