Can anyone help me please... i'm trying to use class instead of Id but class is not working.
<td> <?php $academics=mysql_query("SELECT * FROM tb_academic");
?>
<select onChange="showsub(this.value)" class="required search" id="" name="level"><option>--Select a level--</option>
<?php
while($row=mysql_fetch_array($academics))
{
?>
<option id="<?php echo $row['id']; ?>" value="<?php echo $row['academiclevel']; ?>"><?php echo $row['academiclevel']; ?></option>
<?php
}
?></select></td></tr>
<script>
function showsub(str)
{
if(str=="")
{
document.getElementById("level").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("subjecttwo").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","find_subject.php?q="+str,true);
xmlhttp.send();
}
</script>
<td id="subjects">
</td>
<td id="subjects">
</td>
<td id="subjects">
</td>