Hi hussain,
use the below code and modify accordingly............
<script language="JavaScript">
function ajax()
{
var xmlHttp;
try
{ // Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{ // Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
var resultTxt=xmlHttp.responseText;
//resultTxt would be your result that you send from the servlet
}
}
var any_parameter= document.formName.any_parameter.value;
var url="servletName";
url=url+"?any_parameter="+any_parameter;//any_parameter- this can be a value of a textbox or something
xmlHttp.open("GET",url,true);
xmlHttp.send();
}
</script>
try it........
post if you have any doubts in the above code.........
cheers..................

freddie