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

Bikesh SrivastavaRank #108 · 20.3K reputationPosted Aug 9, 2016, 11:53 PM EDT
Vinay SinghRank #604 · 4K reputationPosted Aug 10, 2016, 12:20 AM EDT
PrakashRank #6,639 · 260 reputationPosted Aug 10, 2016, 12:36 AM EDT