Søren Schimkat wrote:
I´m having some problems with replacing one form with another. The first
problem is the the replace function only works once - and the second problem
is that the thml code dosn´t get interpreted.. but is treated as plain text.
You can se a short example here:
http://www.schimkat.dk/forms.htm
If you want to create an element with a certain element name with the
DOM then use
document.create Element('elemen tname')
so to create a HTML <form> element you use
var form = document.create Element('form') ;
then to create an <input> element you use
var input = document.create Element('input' );
then if you want to have that <input> element as a child of the <form>
element then you have to put it there
form.appendChil d(input);
To set HTML attributes you can use the HTML DOM where the attributes are
modelled as properties of the JavaScript objects so you might want to
set e.g.
form.action = 'whatever.php';
form.name = 'formName';
and
input.type = 'text';
input.name = 'inputName';
Finally to put the whole form into the document you can use e.g.
document.body.a ppendChild(form )
--
Martin Honnen
http://JavaScript.FAQTs.com/