In first part
1.html..i have one combo box
and code as below
this java script part.i have function as below.
when i am using the syntax it return only empty alert....
this php part..
1.html..i have one combo box
and code as below
Code:
<body> <form name="ajax"> <select onchange="request()" id="cmbnum"> <option value=1>ONE</option> <option value=2>TWO</option> <option value=3>THREE</option> </select></form>
when i am using the syntax it return only empty alert....
Code:
function request()
{
optnum=document.getElementById("cmbnum").value;
url="ajax\response.php?num="+optnum;
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4 && xmlhttp.status==200 )
{
ajaxres=xmlhttp.responseText;
document.getElementById("sample").innerHTML=ajaxres;
}
}
xmlhttp.open("GET",url,true);
xmlhttp.send();
}
Code:
if(isset($_REQUEST['num']))
{
switch($_REQUEST['num'])
{
case 1:
echo "ONE";
break;
case 2:
echo "TWO";
break;
}
}
Comment