I need help with mo coding problem. I need to design database update with ORACLE, PHP and JavaScript. So the deal is, I can get the populated dropdown list working and I can see the values. When i select a particular entry, the onchange tag will call java script so it can direcly getting the values from the server.

In this case I could query the corresponding quantity with the headmark. Please help me..

PHP Code:
<script type="text/javascript"
        function 
OnSelectionChange (select) { 
            var 
selectedOption select.options[select.selectedIndex]; 
            
alert ("The selected option is " selectedOption.value); 
        } 
PHP Code:
<label for="headmark" class="lbl-ui select"> 
                                            <?php          
                                            $sql_hm_comp 
'SELECT HEAD_MARK FROM FABRICATION'

                                            
$result oci_parse($conn$sql_hm_comp); 
                                            
oci_execute($result); 

                               
                                            echo 
'<SELECT name="headmark" id="headmark" onchange="OnSelectionChange(this)">'.'<br>'
                                            echo 
'<OPTION VALUE=" ">'."".'</OPTION>'

                                            while(
$row oci_fetch_array($result,OCI_ASSOC)){ 
                                                 
$HM $row ['HEAD_MARK']; 
                                                 echo 
"<OPTION VALUE='$HM'>$HM</OPTION>"
                                            } 
                                            echo 
'</SELECT>'
                                        
?> 
                                        </label>      
                                    </div>     
                                </div>                         
                           </section>                                                   
                          <section> 
                                <div class="row"> 
                                    <div class="col4 first"> 
                                        <label for="lnames" class="lbl-text tleft">Total Quantity:</label> 
                                    </div> 
                                    <div class="col8 last"> 
                                        <label class="lbl-ui"> 
                                        <?php 
                                            
//THIS WILL DISPLAY QUANTITY FOR THE GIVEN HEADMARK 
                                            
$sql_hm_qty "SELECT QTY FROM FABRICATION WHERE HEAD_MARK = '$HM'"

                                            
$qty_result oci_parse($conn$sql_hm_qty); 
                                            
oci_execute($qty_result); 
                                             
                                            
$qty oci_fetch($qty_result); 
                                            echo  
"<label class='lbl-ui'>'.$qty.' </label>"
                                            echo 
$qty
                                        
?>                                       
                                    </div>     
                                </div>                         
                           </section>