Я нашел решение.
<html>
<head>
<script>
function show(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 (this.readyState==4 && this.status==200) {
document.getElementById("txtHint").innerHTML=this.responseText;
}
}
xmlhttp.open("GET","get.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<form>
<?php
echo '<select onchange="show(this.value)">';
$xml = simplexml_load_file('adler.xml');
foreach ($xml->record as $item)
{
echo "<option value='".$item->Grad."'>" . $item->Grad . "</option>";
}
echo "</select>";
?>
</form>
<div id="txtHint"><b>Servis Adler uređaja za </b></div>
</body>
</html>
И файл get.php
<?php
$q=$_GET["q"];
$xmlDoc = new DOMDocument();
$xmlDoc->load("adler.xml");
$x=$xmlDoc->getElementsByTagName('Grad');
for ($i=0; $i<=$x->length-1; $i++) {
//Process only element nodes
if ($x->item($i)->nodeType==1) {
if ($x->item($i)->childNodes->item(0)->nodeValue == $q) {
$y=($x->item($i)->parentNode);
}
}
}
$record=($y->childNodes);
for ($i=0;$i<$record->length;$i++) {
//Process only element nodes
if ($record->item($i)->nodeType==1) {
echo("<b>" . $record->item($i)->nodeName . ":</b> ");
echo($record->item($i)->childNodes->item(0)->nodeValue);
echo("<br>");
}
}
?>