I have a form which includes product name dropdown, quantity field & amount field. I want to fetch price from database when product name is selected and when quantity entered want to show multiplication of price of selected product and quantity in Total amount field. I want to use Jquery. 

image of form:
[![form](https://i.stack.imgur.com/yiqyf.png)](https://i.stack.imgur.com/yiqyf.png)

This is my code:

```
<div class="section row mb10" style="">
  <label for="ordered-product" class="field-label col-md-2 text-center"><i class="fa fa-product"></i></label>
  <div class="col-md-3">
     <label class="field select">
            <select name="orderedproduct[]" id="orderedproduct">
              <option>Select Ordered Product</option>
                <?php
                $query="SELECT * FROM product_list";
                $res=mysql_query($query) or die(mysql_error());
                while($row=mysql_fetch_array($res)){
                echo "<option value='". $row['product_id'] ."'>" .$row['product_name'] ."</option>" ;
                      }
                ?>
            </select>       
      </label>
  </div>
  <label for="product-qty" class="field-label col-md-1 text-center"><i class="fa fa-cubes"></i></label>
  <div class="col-md-2">
    <label for="product-qty" class="field prepend-icon">
    <input type="text" name="productqty[]" id="productqty" class="gui-input" placeholder="Quantity">
    </label>
  </div>
  <label for="order-amount" class="field-label col-md-1 text-center"><i class="fa fa-inr"></i></label>
  <div class="col-md-2">
    <label for="order-ammount" class="field prepend-icon">
      <input type="text" name="orderammount[]" id="orderammount" class="gui-input" disable placeholder="Total Amount">
    </label>
   </div>
</div>

```

Any help will be appreciated. Thank you.

Jquery:

```
$('#orderedproduct','#productqty').change(function(){
    var oproductname = $(this).val();
    $.ajax(
            type:'POST';
            data:{oproductname:oproductname},
            url:'ajax pages/amount.php',
            success:function(data){
                $('#orderedamount').val(data);
    }
});
});

```