Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
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');
var table = document.getElementById('ordertable');
var row = document.createElement('tr');
var td1 = document.createElement('td');
var td2 = document.createElement('td');
td2.appendChild(document.createTextNode('<input name="unit" type="text" size="10" value="">'));
var td3 = document.createElement('td');
td3.appendChild(document.createTextNode('<input name="qty" type="text" size="10" value="">'));
var td4 = document.createElement('td');
td4.appendChild(document.createTextNode('<input name="ext" type="text" size="10" value="">'));

<table >
<tbody id="ordertable">
<td>Part #</td>
<td>Unit Price</td>
<td>Extended Price</td>
<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>

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

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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.