Hi Forum,
I am using xmlHttp.responseText to get the result..... but in result its getting nothing in......
Here's the code.
HTML Code:
var xmlHttp
// Start of loading Constituency //
function loadcity(state_search)
{
var value=document.getElementById('state_search').value;
//var lang=document.getElementById("language").value;
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="controller/city_controller.php";
url=url+"?work=cityinfo";
url=url+"?&state_id="+value;
//url=url+"&lang_id="+lang;
xmlHttp.onreadystatechange=addcityname;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function addcityname()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
val=xmlHttp.responseText; //Here's the problem
alert(val);
document.getElementById('city_infodivxxx').innerHTML=xmlHttp.responseText;
//loadParties('subcat_id');
}
}
I am getting values from my next php file....city_controller.php....
This is what I am trying to display...
PHP Code:
echo "<select size=\"1\" name=\"city_search\" id=\"city_search\" class=\"input_city\" tabindex=\"\"> <option value=\"Select City\">-----Select City-----</option>"; for($i=0;$i<sizeof($result);$i++) { $cityval=explode("/",$result[$i]); //echo $subcat[1]; echo "<option value='".$cityval[0]."'>".$cityval[1]."</option>"; } echo "</select>";
any of your help and suggestions would be highly appreciated.....
Thanks a lot.
|