Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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 February 19th, 2004, 12:40 PM
Authorized User
 
Join Date: Jun 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding new table on page

Hello all,

Just a quick question regarding adding a new table in a form by clicking on a add button using javascript... The idea derived from this site http://www.campusbookstore.com/index...PTBOOKS#Bottom , in the bottom of the page there is an add button which allows users to add on the form another textbook field... Is that possible in Javascript? if so how would i go about trying to accomplish that?

thanks for the assistance...
--dung
 
Old February 20th, 2004, 07:03 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

With a reasonable modern browser all elements are addable dynamically via client side script. The link below has plenty of examples on adding tables and form elements. Also search the archives of these forums for posts. I remember oposting two or three examples of doing this in the past six months.

http://msdn.microsoft.com/library/de...asp?frame=true



--

Joe
 
Old February 20th, 2004, 07:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The function underneath will write a string (newString) to some element identified by id.
Code:
function show(id, newString)
{
    objCell = document.getElementById(id);
    objCell.innerHTML = newString;
}
Then you can probably modify this to your exact needs; that is, naturally without reloading the page.

Jacob.





Similar Threads
Thread Thread Starter Forum Replies Last Post
adding functionality to a table aceconcepts PHP How-To 0 February 16th, 2006 08:59 AM
page take time to load after adding rows in table avanishp General .NET 5 June 21st, 2005 02:32 PM
Adding 2 values in a table Regornil JSP Basics 2 September 13th, 2004 02:32 AM





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