Is it possible to response .write to a div or iframe so that my page doesn't get written over?
here is the code:
<form name="list" action="">
<select name="listGen" onchange="xmlConnect()" size="1">
<option value="0">please choose</option>
<option value="1">sales</option>
<option value="2">IT</option>
<option value="3">Human Resources</option>
<option value="4">Front Office</option>
</select>
</form>
<script type="text/javascript">
function xmlConnect()
{
var x = document.forms['list'].elements['listGen'];
var thevalue = x.options[x.selectedIndex].value;
document.write(thevalue);
xmlDoc=loadXMLDoc("../bin/people.xml");
x=xmlDoc.getElementsByTagName("fname");
y=xmlDoc.getElementsByTagName("lname");
z=xmlDoc.getElementsByTagName("personal");
a=xmlDoc.getElementsByTagName("department");
for (i=0;i<x.length;i++)
{ if (a[i].childNodes[0].nodeValue == thevalue)
{
document.write(x[i].childNodes[0].nodeValue);
document.write(" ");
document.write(y[i].childNodes[0].nodeValue);
document.write(": ");
document.write(z[i].childNodes[0].nodeValue);
document.write("<br />");
document.write("<br />");
}
}