473,382 Members | 1,093 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,382 software developers and data experts.

need guidance to transfer info from one table to another

11
Hello,
I have a form with 4 tables. Table 1 & 2 are not associated with my problem so I'll start with Table3.

Table3 contains an input-textbox; and a push-button to add a new row to Table4. The button also activates a script to transfer the information in the text-box to the new cell in Table4. I originally used cloneNode which works fine:

// cell 1 - input text
document.getElementById("Table3");
var el=document.getElementById("textBox").cloneNode(tr ue);
var cell1 = row.insertCell(1).appendChild(el);

but I only want to transfer the text (not the text-box.) I tried to adapt innerHTML, but am having trouble doing so. What am I doing wrong?:

// cell 1 - input text
document.getElementById("Table3");
var el = document.getElementById("textBox").innerHTML;
var cell1 = row.insertCell(1).textBox(el);

any assistance would be appreciated...

The form address is as follows with "tbNOR" being the name of the textBox:

http://www.aaronzjukebox.com/R2CDorder1
Apr 7 '07 #1
3 1554
Hi pal
Maybe this will help you!
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <!-- Created on: 9-4-2007 -->
  3. <head>
  4.    <title></title>
  5. <script type="text/javascript">
  6. // author : fjhdehoog
  7. function test(){
  8. //document.getElementById("Table3");
  9. el=document.getElementById("textBox").value; 
  10. //get the table by id and assign to varaible
  11. Destinantiontable=document.getElementById("Table4");
  12. //get the table    firstchild , in this case <tbody>
  13. ThaTableBody = Destinantiontable.firstChild; 
  14. //set newrow to be made
  15. NewRow = document.createElement("tr");
  16. //set newcell to be made
  17. NewCell = document.createElement("td");
  18. //set the text to be entert
  19. txt=document.createTextNode(el);
  20. //when newcell is made enter the text
  21. NewCell.appendChild(txt);    
  22. //when newrow is made enter the newcell
  23. NewRow.appendChild(NewCell);
  24. //make the row and add the new cell and insert the text
  25. ThaTableBody.appendChild(NewRow); 
  26. }
  27.  </script>
  28. </head>
  29. <body> 
  30.  
  31. <table border="2" id="Table3" summary="">
  32. <tr><form id="form1">
  33.     <td><input type="text" name="textbox" size="40" maxlength="256" value="test"></td>    
  34.     <td><input type="button" value="send" onclick="test()"></td>
  35.     </form>
  36. </tr>
  37. </table>
  38. <br>
  39. <br>
  40. <table id="table4" border="2" summary="">
  41. <tr>
  42.       <td></td>
  43. </tr>
  44. </body>
  45. </html>
  46.  
well HTH
peace
Apr 9 '07 #2
decren
11
Many Thanks for your quick response. And I also appreciate the time and effort you must have spent on that excellent code. It sure works for me.
Apr 10 '07 #3
hahaha,
no problem mate.

What is knowlegde worth if u donīt share it :).
anyway glad i could help.
happy coding
peace
Apr 10 '07 #4

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

Similar topics

0
by: Dan McCoy | last post by:
I'm new to MYSQL, having just finished my website. I have 1 thing left to try and do to make the site experiance as seemless as possable, but to do it I figure I need to do some sort of mysql...
8
by: Christan | last post by:
I am currently taking a db course and my class is paired us into groups of 4s and our instructor had us download a template from the microsoft Access site for education to create and modify a...
2
by: Tim Marsden | last post by:
Hi, Please excuse me, I am complete ASP novice. I use VB.NET in VS 2003. I am trying to achieve the following. Display a list of items, this list needs to be user specific, so my first...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
5
by: rajaaryan44 | last post by:
how can we transfer data from one access database to another databse . the table name is same for both the database . in one table some records are there (rs say e.g.) now another table has say...
2
by: rajaaryan44 | last post by:
how can we transfer data from one access database to another databse . the table name is same for both the database . in one table some records are there (rs say e.g.) now another table has say rs+10...
9
by: Jonathan Wood | last post by:
Greetings, My app displays users in a GridView control. I'd like to have the name field shown in each row of this control a link that displays another page with information about that user. ...
6
by: smk17 | last post by:
I've spent the last few minutes searching for this question and I found an answer, but it wasn't quite what the client wanted. I have a simple online form where the user needs to fill out five...
1
by: deepaks85 | last post by:
Dear All, I want to send some data through a form with Multiple attachment in an HTML Format. I have tried it but it is not working for me. I am able to send data without attachment but with the...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.