i making a drug storage inventory im using jquery to search for items to insert its quantity , when i repeat every item fields and search for second item and choose it from list , it changes the previews item to the same one like the second one i choose .

here is an example

PHP Code:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
function lookup(inputString) {
    if(inputString.length == 0) {
        // Hide the suggestion box.
        $('#suggestions').hide();
    } else {
        $.post("rpc3.php", {queryString: ""+inputString+""},
 function(data){
            if(data.length >0) {
                $('#suggestions').show();
                $('#autoSuggestionsList').html(data);
            }
        });
    }
} // lookup
function fzl(thisValue) {
    $('.inputString').val(thisValue);
    setTimeout("$('#suggestions').hide();", 200);
}
function fzlz(thisValue) {
    $('.inputStringz').val(thisValue);
}

function fzlzo(thisValue) {
    $('.inputStringzo').val(thisValue);
}
</script>


             <form action="send.php" method="post" name="theform" onsubmit="return formCheck(this);" autocomplete='off'>

<table>

   <tr>

    <td><label>name</label></td>

                <td><input style="text-align: right" type="text" size="30" value="" class="inputString" onkeyup="lookup(this.value);" onblur="fzl();" name="drug" />
         <div class="suggestionsBox" id="suggestions" style="display: none; z-index:10; position: absolute;">

            <div class="suggestionList" id="autoSuggestionsList" lang="ar">
                &nbsp;
            </div>
        </div></td>

       <td><label>code</label></td>


      <td><input style="text-align: right" type="text" size="30" value="" class="inputStringz"  onkeyup="lookup(this.value);" onblur="fzlz();" name="code" /></td>

      <td><label>unit</label></td>

       <td><input style="text-align: right" type="text" size="30" value="" class="inputStringzo"  onkeyup="lookup(this.value);" onblur="fzlzo();" name="unit" /></td>            

        </tr>

        <tr>

    <td><label>name</label></td>

                <td><input style="text-align: right" type="text" size="30" value="" class="inputString" onkeyup="lookup(this.value);" onblur="fzl();" name="drug" />
         <div class="suggestionsBox" id="suggestions" style="display: none; z-index:10; position: absolute;">

            <div class="suggestionList" id="autoSuggestionsList" lang="ar">
                &nbsp;
            </div>
        </div></td>

       <td><label>code</label></td>


      <td><input style="text-align: right" type="text" size="30" value="" class="inputStringz"  onkeyup="lookup(this.value);" onblur="fzlz();" name="code" /></td>

      <td><label>unit</label></td>

       <td><input style="text-align: right" type="text" size="30" value="" class="inputStringzo"  onkeyup="lookup(this.value);" onblur="fzlzo();" name="unit" /></td>            

        </tr>

</table>
</form> 
and this is the php file (rpc3.php)


PHP Code:

<?php

include 'config.php';
if(isset(
$_POST['queryString'])) {
        
$queryString $_POST['queryString'];
        if(
mb_strlen($queryString) > 1) {
$selc "SELECT * FROM `drug_info` WHERE `dru_name` LIKE '%$queryString%' LIMIT 10";
$result mysql_query ($selc);
while (
$row mysql_fetch_array ($result))
{
    
$code $row ["dru_code"];
    
$name $row ["dru_name"];
    
$unit $row ["dru_unit"];
    
$barcode $row ["dru_barcode"];
    echo (
'<li onClick="fzl(\''.$name .'\');fzlz(\''.$code .'\');fzlzo(\''.$unit .'\');fzlzb(\''.$barcode .'\')">' $name '</li>');
}
        }
}

?>

i need to repeat it more about 10 times ... any help please for dis problem