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

DOM: table.insertRow() / table.deleteRow()

Hi

Let's say I have a table that originally have 6 rows and contains 6 <Td>
fields which stores data.

If I were to use dom's deleteRow to remove the rows seamless *and* i wanna
update the changes to the database after the changes are made, what should i
do next?

what should i read up on?

Thanks

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Dec 26 '06 #1
2 7999

User wrote:
Hi

Let's say I have a table that originally have 6 rows and contains 6 <Td>
fields which stores data.

If I were to use dom's deleteRow to remove the rows seamless *and* i wanna
update the changes to the database after the changes are made, what should i
do next?

what should i read up on?
When the user indicates they want to delete a row, have the page make
an Ajax/XMLHttpRequest to the server for approval of this deletion.
When the server responds that the deletion is allowed then delete the
row from the DOM.

Peter

Dec 26 '06 #2
ASM
User a écrit :
Hi

Let's say I have a table that originally have 6 rows and contains 6 <Td>
fields which stores data.

If I were to use dom's deleteRow to remove the rows seamless *and* i wanna
update the changes to the database after the changes are made, what should i
do next?

what should i read up on?
Are TDs of the deleted row filled with text fields (input type=text) ?
If yes, you just need to submit the form and inspect sent resting variables

If not, something like

function feedback(what) {
var T = what.getElementsByTagName('TD');
for(var i=0; i<T.length; i++;} {
if(T[i].id) {
var t = document.createElement('INPUT');
t.name = T[i].id;
t.value = T[i].innerHTML;
what.appendChild(t);
}
}
return true;
}

<form onsubmit="return feedback(this);" ...>
<table>
<tr><td id="Name">User</td><td ...

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Dec 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: foldface | last post by:
Hi This works but is a bit long-winded. Is there a better way? ta F <style> ..Header { background-color: gray;
10
by: AdamG | last post by:
I am trying hard for days now to add and delete rows to a table. I could really use some help... Each row contains two buttons (images) - 'add row' and 'delete row'. When the user clicks add...
1
by: SAN CAZIANO | last post by:
I have create a dynamic html table by adding some rows where I have to put some value in an input field and now how can I get all value of all row ??? I try this but it doesn' work button...
7
by: Christopher Benson-Manica | last post by:
Why is building a table with the DOM slower than using an array? IOW, why is var table=document.createDocumentFragment(); for( var i=0; i < 4000; i++ ) { tr=table.insertRow( table.rows.length...
4
by: Robert Skidmore | last post by:
I made this javascript to help me debug some javascript one time and I have just been adding to it over the years. It is IE specific (sure it would not be to hard to change that). It is not ever...
5
by: JonH | last post by:
Ok, I have this dynamically created table in my one of my php forms that shows the names of the people the user has entered into a text field. When they hit add a row displays, showing the name...
3
by: Michael_R_Banks | last post by:
I'm trying to dynamically build a table that allows users to remove rows when they click a corresponding button. For some reason, whenever I add the button to the table, it never fires the onclick...
5
by: traineeirishprogrammer | last post by:
I am currently learning javascript and DOM. Basically I am currently writing a function to add rows to a table and I am trying to do it using DOM. Each row is made up of 4 cells. Here is the code!!!...
12
by: micky125 | last post by:
Hey guys, another part of program I am stuck at is to create an email storage / reference system. I need the first line to hold the basic info, from to address etc and then a second row to store the...
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
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.