Hi,
I have 3 fields Rate, Quantity and Total
I need to get Total value based upon Rate and Quantity
Could you please help me
@{
Layout = null;
}
<div class="container">
<div class="details">
<table class="table table-responsive">
<tr>
<td>Rate</td>
<td>Quantity</td>
<td>Total</td>
<td> </td>
</tr>
<tr class="mycontainer" id="mainrow">
<td>
<input type="text" id="rate" class="rate form-control" />
</td>
<td>
<input type="text" id="quantity" class="quantity form-control" />
</td>
<td>
<input type="text" id="total" class="total form-control" />
</td>
<td>
<input type="button" id="add" value="add" class="btn btn-success" />
</td>
</tr>
</table>
<div id="orderItems">
<table class="table table-responsive" id="orderdetailsItems"></table>
</div>
</div>
</div>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
//Add button click event
$('#add').click(function () {
//validation and add order items
var isAllValid = true;
if (isAllValid) {
var $newRow = $('#mainrow').clone().removeAttr('id');
//remove id attribute from new clone row
$('#quantity,#Total,#rate,#add', $newRow).removeAttr('id');
$('span.error', $newRow).remove();
//append clone row
$('#orderdetailsItems').append($newRow);
$('#quantity,#rate,#Total').val('');
$('#orderItemError').empty();
}
})
});
</script>