473,406 Members | 2,633 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,406 software developers and data experts.

insertRow but no data after submission

Hi.
I've created a page that dynamically adds rows to a table.
When I submit the page the request parameters of the dynamically
generated rows don't get passed to the server.
What is wrong?
Thanks.
Kind regards.
Luke Baker.

my functions:
--------------------------------------------------\
function removeTableRow() {
var t = document.getElementById('moanFish');
var lastRow = t.rows.length;
if (lastRow 5) t.deleteRow(lastRow - 2);
}
function insertTableRow() {
var names = new Array();
names[0] = "expenseType";
names[1] = "annualAmount";
names[2] = "supplier";
names[3] = "bankAccount";
names[4] = "bank";
names[5] = "bsb";
names[6] = "accountNumber";
names[7] = "ref";
var cells = new Array();
var lastRow = document.getElementById('moanFish').rows.length;
var tblRow =
document.getElementById('moanFish').insertRow(last Row-1);

// populate an ass. array of cell objects for a single table row
// then populate the cells with input elements
for (j = 0; j < 8; j++) {
var rowNumber =
(document.getElementById('moanFish').rows.length)-1;
cells["f"+j] = tblRow.insertCell(j);
var element = document.createElement('input');
element.type = 'text';
// element.name = 'expenseRow3_expenseType';
// element.id = 'expenseRow3_expenseType';
element.name = 'expenseRow' + rowNumber + "_" + names[j];
element.id = 'expenseRow' + rowNumber + "_" + names[j];
if (j == 0 || j == 3) { element.size = 16; }
else { element.size = 10; }
cells["f"+j].appendChild(element);
}
alert(document.getElementById('moanFish').innerHTM L);
// add the right border to the last cell in the row
cells["f7"].style.borderWidth = "1px 1px 0px 1px";
}
__________________________________________________ _____/

Jan 4 '07 #1
3 1652
On Jan 3, 5:50 pm, "edencane" <edenc...@gmail.comwrote:
Hi.
I've created a page that dynamically adds rows to a table.
When I submit the page the request parameters of the dynamically
generated rows don't get passed to the server.
What is wrong?
Thanks.
Kind regards.
Luke Baker.
What server-side language are you using?

Cheers
Chad

Jan 4 '07 #2
Hi.
Ch***********@gmail.com wrote:
What server-side language are you using?
Java. Purely jsp currently.

I've changed the javascript to use innerHTML instead of DOM and it now
works in IE and FF but not Opera9. Hmmmm.

Kind regards.
Luke.

Jan 4 '07 #3
edencane wrote:
I've changed the javascript to use innerHTML instead of DOM and it now
works in IE and FF but not Opera9. Hmmmm.

Kind regards.
Luke.
That is odd. Make sure you didn't switch to innerHTML for the actual
row/cell creation. I don't know about IE7, but in IE6 you can't modify
table rows via innerHTML.

The only thing I could think previously was some sort of server-side
event validation, a-la ASP.NET. Unfortunately I'm not sure with JSP.

You could always serialize the final form with Javascript and submit a
GET request (or Ajax POST).

Cheers
Chad
Jan 4 '07 #4

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

Similar topics

3
by: Marco Alting | last post by:
Hi I'm currently developing a form with a dynamic table. initially the table is populated with data and at the end of each row there are two buttons: addLevel and addItem. Each button creates a...
3
by: milkyway | last post by:
Hello, I am working with an old Java Script code and have found the following but after putting in alerts I have found that insertRow doesn't work. What is the problem? TIA function...
1
by: putty | last post by:
I found a few posts of people asking about insertCell()/insertRow() not working in IE6 SP2, and a few others about getting "null is null or not an object" errors, but no one posted a solution...
2
by: Howard Jess | last post by:
CLJ -- I've searched the newsgroup and FAQ for info on insertRow(), but didn't see this reported. It seems that Internet Explorer doesn't respond correctly to either insertRow() or...
0
by: Marc DVer | last post by:
I am at kind of a loss on how to design a certain database project I am working on. Basically, we have a proprietary program with a standard backend (though we do not have direct write access to...
8
by: Hal Burgiss | last post by:
Hi, and help for a novice trying to get some data dynamically into tables. I did a small proof of concept page which works fine in IE6 and Mozilla. Using code such as this: tbody =...
1
by: Christopher Berg | last post by:
hi. is there a way to add an id='...' tag to a table row when using the javascript insertRow() ? i wish to be able to manipulate this row later if i need to using that identifier (eg to toggle...
1
by: raju78.k | last post by:
Hi, I have a problem with FireFox. I have written a function to Add rows without submiting the form. This function works fine in IE, but not in FireFox. The function is : function...
3
by: DL | last post by:
Here's the thing, I have this HTML Table, that has multile rows already, each has an ID, one of them at the bottom section has id of "SaveData", new TRs are dynamically created upon user...
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: 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...
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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.