<script language="javascript" type="text/javascript">
function display()
{
var ajax = create_ajax_object();
if (ajax)
{
ajax.onreadystatechange = function ()
{
if (ajax.readyState == 4 && ajax.status == 200)
{
document.getElementById("target").innerHTML = ajax.responseText;
}
}
ajax.open("POST", "fetchdata.php", true);
var check = new Array();
var "check[]=" + encodeURIComponent(document.myForm.user.value);
ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
ajax.send(check[]);
}
else
{
alert("Your browser doesnt support AJAX!");
}
}
</script>
<br>
<form name='myForm'>
<input type="checkbox" name="user" value="First" onclick="display();">1
<br>
<input type="checkbox" name="user" value="Second" onclick="display();">2
<br>
<input type="checkbox" name="user" value="Third" onclick="display();">3
<br>
</form>