I want to change this code (dropdown select course) into typeahead so i just need to type a few word and then, it will suggest.
<TD width="112"><INPUT type="checkbox" name="chk[]"/></TD>
<TD width="472">
<SELECT name="course[]">
<?php
$sql = "select * from tt_course";
$result = mysql_query($sql);
while($rs = mysql_fetch_assoc($result))
{
$select="";
echo "<option value=\"".$rs['course_id']."\" ".$select.">".$rs['course_name']."</option>";
}
?>
</SELECT>
</TD>
Have a look at http://jqueryui.com/demos/autocomplete/
Its simple and easy to setup and will serve the purpose. You can create an array of values and provide it to Autocomplete or you can make it call your php page and parse the returned JSON data.
As promised, here is an example code to get you going. Please note that this code uses a local javascript variable to prepare suggestions for the autocomplete box. You can easily update that to look for JSON data from your php page and i could easily have made you even that but purpose is to help you learn so i think this way it would be better for you so that you can see how it works and then update it to your needs accordingly. Here you go, you can simply copy paste this code and see it running