View Full Version : Creating and removing form fields

02-03-2004, 12:31 PM
Hey there, does anybody knows how to create-remove a new field in a form, using JS, Also is there any javascript api, something that depicts the functions and parameters etc...I have seen so many functions like the getElementsById, or document.something.something...... but dont know what to expect. having the api will no bother anymore


02-03-2004, 10:20 PM
Yeah, Document Object Model (DOM) will do it all, but there's a learning curve. VERY briefly it might look like this:

function buildTable () {
var theTable = createObject ('table');
var aTbody = createObject ('tbody');
var aRow = createObject('tr');
var aCell = createObject('td');


that's not even scratching the surface. DOM is a very rich and powerful API.