DHTML / form elements

Q

Q1tum

Hi there,

I've started using DHTML to dynamicly build a part of my page, I now
need to add a form element (select and textarea), I tryed several
things but it is not working.

if I use the following to create a text field, how can I display it in
the table / form?
(I tried something with: appendChild(input) but that would not work,
perhaps I'm doing it wrong.

var input = document.createElement('input');
input.type = 'text';
input.id = 'inputName';
input.name = 'inputName';

This is my first post here, I hope this is the right place to post my
question.

Regards,

Arno
 
M

Mick White

Q1tum said:
Hi there,

I've started using DHTML to dynamicly build a part of my page, I now
need to add a form element (select and textarea), I tryed several
things but it is not working.

if I use the following to create a text field, how can I display it in
the table / form?
(I tried something with: appendChild(input) but that would not work,
perhaps I'm doing it wrong.


referenceToElement.appendChild(input)
for example:
document.getElementById("elementIDHere").appendChild(input)
document.forms["formNameHere"].appendChild(input)

I dont like the use of "input" as a name for a variable, although it
should work.


Mick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top