You just have to include following script.
<script language="javascript" type="text/javascript">
var xmlHttp
function showState(str)
{
//if you want any text box value you can get it like below line.
//just make sure you have specified its "id" attribute
var name=document.getElementById("id_attr").value;
if (typeof XMLHttpRequest != "undefined")
{
xmlHttp= new XMLHttpRequest();
}
var url="forwardPage.jsp";
url +="?count1=" +str+"&count2="+name";
xmlHttp.onreadystatechange = stateChange;
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
}
function stateChange()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("div_id").innerHTML=xmlHttp.responseText
}
}
</script>
So if you got the code, let me tell you, div_id will be id of div tag where you have to show your result. By using this code, you are passing parameters to another page. Whatever the processing is done there will be reflected in div tag whose id is "div_id". You can call showState(this.value) on "onChange" event of any control or "onClick" event of button not submit. Further queries will be appreciated.