Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0
This is the forum to discuss the Wrox book Professional JavaScript for Web Developers by Nicholas C. Zakas; ISBN: 9780764579080
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 26th, 2009, 06:20 PM
Registered User
 
Join Date: May 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default appendChild to add rows to table not working in ff

I am making a form that has 4 inputs per item (item #, price, quantity, extended price). I am formatting the form in a table and I want to be able to add another row of inputs when the user clicks the button. it is working in ie but not ff. I realize that i need to change the inputs to innerHTML but nothing is appearing in ff even when i try to append the <p>

function addRow() {
var row = document.createElement('p');
row.appendChild(document.createTextNode("hi"));
document.body.appendChild(row);
var table = document.getElementById('ordertable');
var row = document.createElement('tr');
table.appendChild(row);
var td1 = document.createElement('td');
td1.appendChild(document.createTextNode("hi"));
row.appendChild(td1);
var td2 = document.createElement('td');
td2.appendChild(document.createTextNode('<input name="unit" type="text" size="10" value="">'));
row.appendChild(td2);
var td3 = document.createElement('td');
td3.appendChild(document.createTextNode('<input name="qty" type="text" size="10" value="">'));
row.appendChild(td3);
var td4 = document.createElement('td');
td4.appendChild(document.createTextNode('<input name="ext" type="text" size="10" value="">'));
row.appendChild(td4);
}

------html----------
<table >
<tbody id="ordertable">
<tr>
<td>Part #</td>
<td>Unit Price</td>
<td>Quanity</td>
<td>Extended Price</td>
</tr>
<tr>
<td><input name="part" type="text" size="10" value=""></td>
<td><input name="unit" type="text" size="10" value=""></td>
<td><input name="qty" type="text" size="10" value=""></td>
<td><input name="ext" type="text" size="10" value=""></td>
</tr>
</tbody>
</table>

<a href="javascript:addRow()">Add another row</a><br>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Rows to Grid View dpkbahuguna ASP.NET 1.x and 2.0 Application Design 0 March 19th, 2008 04:05 AM
SWF elements in DW2004 not working in FF snejsnej Dreamweaver (all versions) 4 February 17th, 2006 03:28 PM
fade in not working in FF but does in IE crmpicco Javascript How-To 1 November 8th, 2005 12:49 PM
How to add rows in DataGrid ? vivekian ASP.NET 1.0 and 1.1 Professional 0 March 13th, 2005 04:30 AM
How to add rows in DataGrid ? vivekian ASP.NET 1.0 and 1.1 Basics 0 March 13th, 2005 04:28 AM



All times are GMT -4. The time now is 10:46 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.