Chandrasekaran C

Chandrasekaran C

  • 1.8k
  • 141
  • 2.2k

How to I get values of n numbers of table row input in asp?

Aug 31 2019 2:11 AM
I done the input field as custom if cusomer need we create n numbers, But How I get this N number value to store db 
//Web Page
<table id="epcgCon">
<th>Description of Items</th>
//Description Item String value
//Qty in integer
<td>// Remove button
<input type="button" onclick="AddRow('epcgCon')" value="ADD ROW" />
<input type="button" onclick="Submit()" value="Submit" />
//JavaScript Coding...
var count = "1";
function AddRow(in_tbl_name) {
var tbody = document.getElementById(in_tbl_name).getElementsByTagName("TBODY")[0];
// create row
var row = document.createElement("TR");
// create table cell 2
var td1 = document.createElement("TD")
var strHtml2 = ""+count;
td1.innerHTML = strHtml2.replace(/!count!/g, count);
// create table cell 3
var td2 = document.createElement("TD")
var strHtml3 = "<input type=\"text\" name=\"Descr\" />";
td2.innerHTML = strHtml3.replace(/!count!/g, count);
// create table cell 4
var td3 = document.createElement("TD")
var strHtml4 = "<input type=\"text\" name=\"Qty\" />";
td3.innerHTML = strHtml4.replace(/!count!/g, count);
// create table cell 5
var td4 = document.createElement("TD")
var strHtml5 = "<input type=\"button\" value=\"Remove\" onClick=\"delRow()\"/>";
td4.innerHTML = strHtml5.replace(/!count!/g, count);
// append data to row
count = parseInt(count) + 1;
// add to count variable
// append row to table
function delRow() {
var current = window.event.srcElement;
//here we will delete the line
while ((current = current.parentElement) && current.tagName != "TR");
}//Delete Row END
var desc=document.getElementByName('Descr');
var qty=document.getElementByName('Qty');
// I need help on this How to I get value from if n numbers and insert into DB

Brought to you by:

Answers (3)