...

View Full Version : Creating and removing form fields



vihv
02-03-2004, 11:31 AM
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

:)

RadarBob
02-03-2004, 09: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');

aRow.appendChild(aCell);
aTbody.appendChild(aRow);
theTable.appendChild(aTbody);
}


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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum