hiii
i am using the following functions in javascript to dynamically add and remove rows from a table...

function addRow()
   {   
   
    //add a row to the rows collection and get a reference to the newly added row
   var newRow = document.all("applications").insertRow();
    //add 3 cells (<td>) to the new row and set the innerHTML to contain text boxes
    
    var oCell = newRow.insertCell();
   
    oCell.innerHTML = "<input type='text' name='application_name'  class='cellData' maxlength='20' style='width:220px;height:17px'size='45' title='Enter Application Name'>";
    oCell = newRow.insertCell();
    oCell.innerHTML = "<input type='text' name='application_add_ticket_no'  class='cellData' maxlength='20' style='width:220px;height:17px'size='45' title='Enter Application Access Ticket Number'>";
    oCell = newRow.insertCell();
oCell.innerHTML = "<input type='text' name='application_add_date'  class='cellData' maxlength='10' style='width:220px;height:17px'size='45' title='Enter Applicatin Access Date' value='mm/dd/yyyy'>";
oCell = newRow.insertCell();
 oCell.innerHTML = "<a href='javascript:void();'  onclick='removeRow(this);'><font color='red' size='5'>-</font></a>";
oCell = newRow.insertCell();
oCell.innerHTML = "<a href='javascript:void();'  onclick='addRow(this);'><font color='blue' size='4'>+</font></a>";
}
   
function removeRow(src)
   { 
    var oRow = src.parentElement.parentElement;    
    document.all("applications").deleteRow(oRow.rowIndex);  

   }

i need to store these values in sql server...
can anyone show me the way to do that ??
thanks....

You can use following code to fetch form details

'  Request("application_name").count to get the number of rows
For count=1 to Request("application_name").count
        application_name = Request("application_name ")(count)
        application_add_ticket_no = Request("application_add_ticket_no")(count)
        application_add_date = Request("application_add_date")(count)
        ' code to store details in sqlserver will come here.
 
next
commented: thanks... +2

yups
figured that out.............
thanks...

no probs.
Please mark thread as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.