Hello Experts,
I want to create invoice for product.Using MVC and jquery
I have dynamic generated text box by clicking on add product button
I generated dynamic id for textbox but i cant get value from newly created textbox.
Please help
below the whole code
$(document).ready(function () {
function addRow() {
var html = '' + ';
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
'
$(html).appendTo($("#Table1"));
i++;
};
$("#Table1").on("click", "#btnadd", addRow);
function deleteRow() {
var par = $(this).parent().parent();
par.remove();
};
$("#Table1").on("click", "#btnremove", deleteRow);
if ($("#txtTotalAmount").val().length == 0) {
$("#txtTotalAmount").val("0.00");
};
if ($("#txtsubtotal").val().length == 0) {
$("#txtsubtotal").val("0.00");
};
if ($("#DiscountApplied").val().length == 0) {
$("#DiscountApplied").val("0.00");
};
if ($("#TotalAmount").val().length == 0) {
$("#TotalAmount").val("0.00");
};
});
function calculateSubtotal() {
var Amount = document.getElementById('txtAmount_').value;
var Quantity = document.getElementById('txtQyantity').value;
var TotalAmount = Amount * Quantity;
$('#txtsubtotal').val(TotalAmount);
$('#txtTotalAmount').val(TotalAmount)
}
function calculateTotal() {
var Discount = document.getElementById('DiscountApplied').value;
var Subtotal = document.getElementById('txtsubtotal').value;
if (Discount > 0 && Subtotal > 0) {
var DiscountCalculate = (Discount * Subtotal)/100;
var Result = Subtotal - DiscountCalculate;
}
else {
var Result = 0;
}
$('#TotalAmount').val(Result);
}
Thank You
PrakashPosted Aug 10, 2016, 4:36 AM
Vinay SinghPosted Aug 10, 2016, 4:20 AM
Bikesh SrivastavaPosted Aug 10, 2016, 3:53 AM