the getElementbyId is undefined for some reason, but its there ?
...
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript">
<!--
function createRequestObject() {
var req;
if(window.XMLHttpRequest){
// Firefox, Safari, Opera...
req = new XMLHttpRequest();
} else if(window.ActiveXObject) {
// Internet Explorer 5+
req = new ActiveXObject("Microsoft.XMLHTTP");
} else {
// There is an error creating the object,
// just as an old browser is being used.
alert('Problem creating the XMLHttpRequest object');
}
return req;
}
// Make the XMLHttpRequest object
var http = createRequestObject();
function sendRequest(act) {
//alert("fired "+act);
//alert("send request");
// Open PHP script for requests
http.abort();
http.open('post', 'modules/doit.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.send('country='+act);
document.getElementById("ajaxCountry").innerHTML=act;
// document.getElementById("ajaxTest").innerHTML=act;
http.onreadystatechange = handleResponse;
}
function setCity(act){
document.getElementById("ajaxCity").innerHTML=act;
}
function handleResponse() {
if(http.readyState == 4 && http.status == 200){
//alert("ajax loaded "+http.responseText);
// Text returned FROM the PHP script
var response = http.responseText;
// var response ="text~value|text~value|text~value|text~value|";
if(response!="" || response != false) {
alert("ok here rsponse = "+response);
// UPDATE select box sel2 content
sel = getElementById['cities'].sel2;
//clear old content
alert("ok here sel = "+sel);
/* while (sel.options.length)
{
sel.remove(0);
}*/
//split the incoming string to create array arrOpt which contians the pairs of content
sel.options[0] = new Option("me","too");
/*var arrOpt = response.split("|");
alert("ok here arrOpt= "+arrOpt);
for(var i = 0; i< arrOpt.length-1;i++){
var arrVal = arrOpt[i].split("~");
sel.options[sel.options.length] = new Option(arrVal [0],arrVal[1]);
}*/
document.getElementById("ajaxTest").innerHTML ="response";
}
else{
alert("response was equal to nowt ="+response);
}
}
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
Please select a country from the drop down box below.<br><br><form id="places" action="/landed.at/" method="post" name="form01"><select size="10" name="sel1" onchange="javascript:sendRequest(sel1.value)"><option value="1">Afghanistan</option><option value="2">Albania</option><option value="3">Algeria</option><option value="4">American Samoa</option><option value="5">Andorra</option><option value="6">Angola</option><option value="7">Anguilla</option><option value="8">Antarctica</option><option value="9">Antigua and Barbuda</option><option value="10">Argentina</option><option value="11">Armenia</option><option value="12">Aruba</option><option value="13">Ashmore and Cartier</option><option value="272">Zaire</option><option value="273">Zambia</option><option value="274">Zimbabwe</option><option value="275">Palestinian Territory, Occupied</option></select></form><div id='ajaxTest'>ggg</div>
<form id="cities" name="form2" method="post" action="">
<select name="sel2" onclick="javascript:setCity(sel2.value)">
</select>
</form>
<br /><br />
</body>
</html>
</td>
</tr>
<tr>
<td colspan="3">
<div align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="700">There are no items to display</td>
<td valign="top"> <div class="moduletable">
</div>
</td>
</tr>
</table>
</div>
<br />
<div align="center" class="header_right">
(C) 2007 landed.at</div>
<div align="center">
</div></td>
</tr>
<tr>
<td class="header_left" colspan="3"><a href="http://www.tri-x-directory.com/">Tri-X-Directory</a>
<script type="text/javascript"><!--
google_ad_client = "pub-5653652306821260";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<script language="javascript">
var uri = 'http://impgb.tradedoubler.com/imp/img/507633/1173511?' + new String (Math.random()).substring (2, 11);
document.write('<a href="http://clkuk.tradedoubler.com/click?p=4506&a=1173511&g=507633" target="_blank"><img src="'+uri+'" border=0></a>');
</script>
<div class="syndicate">
<div align="center">
<a href="index2.php?option=com_rss&feed=RSS0.91&no_html=1">
<img src="http://localhost/landed.at/images/M_images/rss091.gif" alt="RSS 0.91" align="middle" name="RSS_091" border="0" /></a>
</div>
<div align="center">
<a href="index2.php?option=com_rss&feed=RSS1.0&no_html=1">
<img src="http://localhost/landed.at/images/M_images/rss10.gif" alt="RSS 1.0" align="middle" name="RSS_10" border="0" /></a>
</div>
<div align="center">
<a href="index2.php?option=com_rss&feed=RSS2.0&no_html=1">
<img src="http://localhost/landed.at/images/M_images/rss20.gif" alt="RSS 2.0" align="middle" name="RSS_20" border="0" /></a>
</div>
<div align="center">
<a href="index2.php?option=com_rss&feed=ATOM0.3&no_html=1">
<img src="http://localhost/landed.at/images/M_images/atom03.gif" alt="ATOM 0.3" align="middle" name="ATOM_03" border="0" /></a>
</div>
<div align="center">
<a href="index2.php?option=com_rss&feed=OPML&no_html=1">
<img src="http://localhost/landed.at/images/M_images/opml.png" alt="OPML" align="middle" name="OPML" border="0" /></a>
</div>
</div></td>
</tr></table>
</td></tr>
</table>
<script type="text/javascript">
_uacct = "UA-543330-4";
urchinTracker();
</script></body>
</html> [/CODE]