learner86
10-19-2007, 07:40 AM
Hi i've to combo boxes one for title ids and one for author ids... once i select title id author ids corresponding to tat title id should get loaded from the database.. i'm posting the whole code kindly help...
<script type="text/javascript">
function getEmployee()
{
xmlHttp=GetXmlHttpObject();
alert(xmlHttp);
var val=document.getElementById("projectName").value;
alert("i");
//xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="http://localhost:8080/timetracker2_original/Review_Timesheet1.jsp";
url=url+"?projname="+val;
url=url+"&sid="+Math.random();
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=function()
{
var status;
var statusText;
try{ status = xmlHttp.status;}catch(e){document.write("Status Error "+status);}
try{ statusText = xmlHttp.statusText}catch(e){document.write("StatusText Error !!! "+statusText);}
//handle processed output
if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
// store processed response text
var getVal = xmlHttp.responseText;
//document.getElementById("res").innerHTML=getVal;
}
}
xmlHttp.send(null);
alert(url);
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
//document.write("XMLHttpRequest();");
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
//document.write("XMLHttpRequest2();");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
document.write("XMLHttpRequest3();");
}
}
return xmlHttp;
}
</script>
This code is inside the jsp page mentioned in the url varialbe i.e., Review_Timesheet1.jsp
<script type="text/javascript">
function getEmployee()
{
xmlHttp=GetXmlHttpObject();
alert(xmlHttp);
var val=document.getElementById("projectName").value;
alert("i");
//xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="http://localhost:8080/timetracker2_original/Review_Timesheet1.jsp";
url=url+"?projname="+val;
url=url+"&sid="+Math.random();
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=function()
{
var status;
var statusText;
try{ status = xmlHttp.status;}catch(e){document.write("Status Error "+status);}
try{ statusText = xmlHttp.statusText}catch(e){document.write("StatusText Error !!! "+statusText);}
//handle processed output
if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
// store processed response text
var getVal = xmlHttp.responseText;
//document.getElementById("res").innerHTML=getVal;
}
}
xmlHttp.send(null);
alert(url);
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
//document.write("XMLHttpRequest();");
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
//document.write("XMLHttpRequest2();");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
document.write("XMLHttpRequest3();");
}
}
return xmlHttp;
}
</script>
This code is inside the jsp page mentioned in the url varialbe i.e., Review_Timesheet1.jsp