473,385 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

save dynamicaly created table to the database....

hi
i am using this code for adding /deleting rows dynamically :

Expand|Select|Wrap|Line Numbers
  1. function addRow()
  2. {
  3.   var tbl = document.getElementById('applications');
  4.   var lastRow = tbl.rows.length;
  5.   // if there's no header row in the table, then iteration = lastRow + 1
  6.   var iteration = lastRow;
  7.   var row = tbl.insertRow(lastRow);
  8.  
  9.  
  10.   // right cell
  11.   var cellRight = row.insertCell(0);
  12.   var el = document.createElement('input');
  13.  
  14.   el.type = 'text';
  15.   el.name = 'application_field1' + iteration;
  16.   el.id = 'application_field1' + iteration;
  17.   el.size = 45;
  18.   el.className='cellData';
  19.   el.style.width='220px'
  20.   el.style.height='17px'
  21.   el.title='Enter Application Name'
  22.   //el.onkeypress = keyPressTest;
  23.   cellRight.appendChild(el);
  24.  
  25.  
  26.  
  27.   var cellMiddle = row.insertCell(1);
  28.   var fl = document.createElement('input');
  29.  
  30.   fl.type = 'text';
  31.   fl.name = 'application_field2' + iteration;
  32.   fl.id = 'application_field2' + iteration;
  33.   fl.size = 45;
  34.   fl.className='cellData';
  35.   fl.style.width='220px'
  36.   fl.style.height='17px'
  37.   fl.title='Enter Application Ticket Number'
  38.   //el.onkeypress = keyPressTest;
  39.   cellMiddle.appendChild(fl);
  40.  
  41.  
  42.   var cellLeft = row.insertCell(2);
  43.   var gl = document.createElement('input');
  44.  
  45.   gl.type = 'text';
  46.   gl.name = 'application_field3' + iteration;
  47.   gl.id = 'application_field3' + iteration;
  48.   gl.size = 45;
  49.   gl.className='cellData';
  50.   gl.style.width='220px'
  51.   gl.style.height='17px'
  52.   gl.value='mm/dd/yyyy'
  53.   gl.onfocus= function() {gl.value=""};
  54.   gl.title='Enter Application Ticket Number'
  55.   //el.onkeypress = keyPressTest;
  56.   cellLeft.appendChild(gl);
  57.  
  58.   }
  59.  
  60.   function removeRow()
  61. {
  62.   var tbl = document.getElementById('applications');
  63.   var lastRow = tbl.rows.length;
  64.   if (lastRow > 3) tbl.deleteRow(lastRow - 1);
  65. }
  66.  
  67.  
  68.  

how can i save these to the database ??
Jul 8 '09 #1
5 1761
Dormilich
8,658 Expert Mod 8TB
@aashishn86
in general, create a form, insert the data to save, submit the form*, use a server script to save the submitted data to the DB.

* - can also be done via AJAX
Jul 8 '09 #2
i create the form...
and submit the page to another page...
now how do i access this data on the other page ???
Jul 8 '09 #3
hi
i have been able to retreive the valeues in the next form using
request.form

what do i do next to save them in sql
Jul 8 '09 #4
acoder
16,027 Expert Mod 8TB
That's not a JavaScript question. Ask in the forum relevant to your server-side language.
Jul 8 '09 #5
sorry..
can you move it to the asp forum please...
Jul 8 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of...
2
by: Paul | last post by:
I am trying to get a form to dynamicaly add hidden elements. Below is the function I've created, basicaly it loops thru an array and attempts to add those values to a newly created hidden input...
3
by: minigitoo | last post by:
Hi I try to get dynamicaly all requests made to DB2 I process like this: 1) I stop then start my instance of database in the db2 control center 2) I use : db2 update monitor switches using...
11
by: deko | last post by:
I need to create different recordsets based on queries that use data from unbound fields in a form. I've discovered that I can't do this, and instead need to save the data in question (usually a...
4
by: nicholas | last post by:
I tried to set the ID of a radiobuttonlist dynamicaly like this: <asp:RadioButtonList id="<%# DataBinder.Eval(Container.DataItem, "optionnameFR") %>" runat="server" ></asp:RadioButtonList> ...
5
by: sam | last post by:
Hi all, I am dynamically creating a table rows and inerting radio buttons which are also dynamically created. Everything works fine in Firefox as expected. But I am not able to select radio...
3
by: needin4mation | last post by:
Hi, I have access 97. I can upgrade if I have to (but that will cost more money :)). If I want to read a row, parse that row, and then save the values to an HTML file, will VBA do that? Say I...
4
by: kev | last post by:
Hi folks, I have created a database to store information on equipments. During the first level of registration, there is a form that i need the user to fill up details on the equipment testing....
2
by: Karl | last post by:
Using A2000 When I click the save icon in form design, Access closes immediately. No warning messges, nothing. This happens on only one form. I deleted the form and recreated it. I could save...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.