943,840 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Marked Solved
  • Views: 1434
  • ASP RSS
Jul 7th, 2009
0

save dynamically created table in sql using asp

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

ASP Syntax (Toggle Plain Text)
  1. function addRow()
  2. {
  3.  
  4. //add a row to the rows collection and get a reference to the newly added row
  5. var newRow = document.all("applications").insertRow();
  6. //add 3 cells (<td>) to the new row and set the innerHTML to contain text boxes
  7.  
  8. var oCell = newRow.insertCell();
  9.  
  10. oCell.innerHTML = "<input type='text' name='application_name' class='cellData' maxlength='20' style='width:220px;height:17px'size='45' title='Enter Application Name'>";
  11. oCell = newRow.insertCell();
  12. 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'>";
  13. oCell = newRow.insertCell();
  14. 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'>";
  15. oCell = newRow.insertCell();
  16. oCell.innerHTML = "<a href='javascript:void();' onclick='removeRow(this);'><font color='red' size='5'>-</font></a>";
  17. oCell = newRow.insertCell();
  18. oCell.innerHTML = "<a href='javascript:void();' onclick='addRow(this);'><font color='blue' size='4'>+</font></a>";
  19. }
  20.  
  21. function removeRow(src)
  22. {
  23. var oRow = src.parentElement.parentElement;
  24. document.all("applications").deleteRow(oRow.rowIndex);
  25.  
  26. }

i need to store these values in sql server...
can anyone show me the way to do that ??
thanks....
Reputation Points: 10
Solved Threads: 9
Junior Poster
aashishn86 is offline Offline
184 posts
since Jun 2008
Jul 14th, 2009
1

Re: save dynamically created table in sql using asp

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
Reputation Points: 12
Solved Threads: 3
Light Poster
punitdam is offline Offline
32 posts
since May 2008
Jul 15th, 2009
0

Re: save dynamically created table in sql using asp

yups
figured that out.............
thanks...
Reputation Points: 10
Solved Threads: 9
Junior Poster
aashishn86 is offline Offline
184 posts
since Jun 2008
Jul 16th, 2009
0

Re: save dynamically created table in sql using asp

no probs.
Please mark thread as solved.
Reputation Points: 12
Solved Threads: 3
Light Poster
punitdam is offline Offline
32 posts
since May 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: page redirects on ASPxMenu
Next Thread in ASP Forum Timeline: ASP Email Form Sending but Content Not Being Sent





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC