Loading Data using ComboBox

Hi guys, I’m stuck, I don’t know what is the error on my code but I guess, I made it correct. I am loading a data using combo box through AJAX below are my codes.

my AJAX Script


function loadawardsdetail(strID)
{
  var aHttpRequest;
  
  if(window.XMLHttpRequest)
    aHttpRequest=new XMLHttpRequest();
  else
    aHttpRequest=new ActiveXObject("Microsoft.XMLHTTP");
    
  aHttpRequest.onreadystatechange = function()
  {
    if((aHttpRequest.readyState == 4) && (aHttpRequest.status == 200))
    {
      var list = document.getElementById('grid');
      list.innerHTML = aHttpRequest.responseText;
    }
    
    aHttpRequest.open(GET,"ajaxloadawards.php?id="+strID,true);
    aHttpRequest.send();
  }
}

award.php


<form method="post">
          <label class="label_s">Competition Details:</label>
          <select name="cboCompetitionID" id="cboCompetitionID" class="entry" onChange="javascript:loadawardsdetail(this.value)">
            <option value="">&nbsp;</option>
            <?php
              $query = "SELECT competitionid, description FROM competitiondetails WHERE 
                        currentyear=year(curdate())";
              $result = mysql_query($query);
              if(mysql_num_rows($result)>0)
              {
                while($details = mysql_fetch_array($result))
                {                
                  echo "<option value=$details[competitionid]";
                        if($_POST['cboCompetitionID']==$details['competitionid'])
                          echo " selected=selected>$details[description]</option>";
                        else
                          echo ">$details[description]</option>";
                }
              }
            ?>
          </select>
          <label class="required">*</label><br class="br" />
         
          <label class="label_s">Description:</label><input type="text" name="txtDescription" size="80%" maxLength="255" class="entry" />
          <label class="required">*</label><br class="br" />
         
          <label class="label_s">&nbsp;</label><input type="submit" name="cmdSave" value="SAVE" class="buttons" />
          <br />
      </form>
      <div id="grid"></div>

ajaxloadawards.php


<?php
  include("includes/connection.php");
  $query = "SELECT * FROM award WHERE competitionid='$_GET[id]'";
  $result = mysql_query($query);
  if(mysql_num_rows($result)>0)
  {
    echo "<table>";
    echo "<tr><td>Awards</td>";
    echo "<td>Status</td>";
    while($award = mysql_fetch_array($result))
    {
      echo "<tr>";
      echo "<td>$award[details]</td>";
      $query = "SELECT * FROM subcriteria WHERE awardid=$award[id]";
      $criteria = mysql_query($query);
      if(mysql_num_rows($criteria)>0)
        echo "<td>Edit Criteria</td>";
      else
        echo "<td>Create Criteria</td>";
      echo "</tr>";
    }
  }    
  echo "</table>";
?>

Can you please help guys.

Can you check my code, if I made something wrong. Please…

Thank you much, I didn’t notice that.

Yeah, my code already works. Thanks again.