 <!DOCTYPE html>
<html>
<head>
<title>Select</title>
<meta charset="utf-8">
<script>
function showSELECT(str) {
    if (str == "") {
        document.getElementById("rselecturi").innerHTML = "";
        return;
    } else {
        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("rselecturi").innerHTML = xmlhttp.responseText;
            }
        }
        xmlhttp.open("GET","getstd.php?q="+str,true);
        xmlhttp.send();
    }
}
</script>

</head>
<body>

<h1>Exemple cu select</h1>
<form>
	<select name="sel" id="selecturi" onchange="showSELECT(this.value)">
		<option value="SELECT * FROM student ORDER BY nume ASC">SELECT * FROM student ORDER BY nume ASC</option>
		<option value="SELECT * FROM student">SELECT * FROM student</option>
		<option value="SELECT * FROM student ORDER BY nume DESC">SELECT * FROM student ORDER BY nume DESC</option>
	</select>
	<div id="rselecturi">Aici vine rezultatul selectului</div>

</body>
</html>
