hi
i am using this code for adding /deleting rows dynamically :
how can i save these to the database ??
i am using this code for adding /deleting rows dynamically :
Code:
function addRow()
{
var tbl = document.getElementById('applications');
var lastRow = tbl.rows.length;
// if there's no header row in the table, then iteration = lastRow + 1
var iteration = lastRow;
var row = tbl.insertRow(lastRow);
// right cell
var cellRight = row.insertCell(0);
var el = document.createElement('input');
el.type = 'text';
el.name = 'application_field1' + iteration;
el.id = 'application_field1' + iteration;
el.size = 45;
el.className='cellData';
el.style.width='220px'
el.style.height='17px'
el.title='Enter Application Name'
//el.onkeypress = keyPressTest;
cellRight.appendChild(el);
var cellMiddle = row.insertCell(1);
var fl = document.createElement('input');
fl.type = 'text';
fl.name = 'application_field2' + iteration;
fl.id = 'application_field2' + iteration;
fl.size = 45;
fl.className='cellData';
fl.style.width='220px'
fl.style.height='17px'
fl.title='Enter Application Ticket Number'
//el.onkeypress = keyPressTest;
cellMiddle.appendChild(fl);
var cellLeft = row.insertCell(2);
var gl = document.createElement('input');
gl.type = 'text';
gl.name = 'application_field3' + iteration;
gl.id = 'application_field3' + iteration;
gl.size = 45;
gl.className='cellData';
gl.style.width='220px'
gl.style.height='17px'
gl.value='mm/dd/yyyy'
gl.onfocus= function() {gl.value=""};
gl.title='Enter Application Ticket Number'
//el.onkeypress = keyPressTest;
cellLeft.appendChild(gl);
}
function removeRow()
{
var tbl = document.getElementById('applications');
var lastRow = tbl.rows.length;
if (lastRow > 3) tbl.deleteRow(lastRow - 1);
}
how can i save these to the database ??
Comment