Hi
all

I am using the list box to send the data to server using ajax and getting the response.

Here is the code

<script type="text/JavaScript">

function showUser(str)
{

if (str.length==0)
{
document.getElementById('txtHint').innerHTML="";
return;
}

var url="/tim/kerproject/phpforms/facultyajax.php";
url=url+"?q="+str;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById('txtHint').innerHTML=xmlhttp.responseText;
}
}
//xmlhttp.open("GET","ajatest2.php?q="+str,true);
xmlhttp.open("GET",url,true);
xmlhttp.send();
}

</script>


<?php

include("config1.php");
$result=mysql_query("select batch_id from batch_master");

echo "<select name='batchid' id='batchid' onchange='showUser(this.value)'>";
echo "<option value=''>Select </option>";

while($row=mysql_fetch_array($result))
{
$bat=$row['batch_id'];
echo "<option value='$bat'>$bat";
}
echo"</select>";




echo"<br />";
echo"<div id='txtHint'>";
echo"</div>";

?>


In this list box we can select single value and send it to ajax.

Now I want to select multiple values from the listbox and send it to ajax.

please help me out

Thanks

MD.Samiuddin