How to create dropdown list?

L

Leszek

Hi

I'm using this code to change a table cell into text input:
pole=document.createElement("input");
pole.type="text";
pole.size="40";
pole.value=""+opis;
pole.id="opis"+id;
pole.name="opis"+id;
pole.className="guzik1";
document.getElementById("opis"+id).replaceChild(pole,document.getElementById("opis"+id).childNodes[0]);

This works ok but what i need is to change another table cell into dropdown
list with 6 options
(table cell has its id)
Is it possible to do it in similar way?

Thanks for help.
Leszek
 
R

RobG

Leszek said:
Hi

I'm using this code to change a table cell into text input:
pole=document.createElement("input");
pole.type="text";
pole.size="40";
pole.value=""+opis;
pole.id="opis"+id;
pole.name="opis"+id;
pole.className="guzik1";
document.getElementById("opis"+id).replaceChild(pole,document.getElementById("opis"+id).childNodes[0]);

This works ok but what i need is to change another table cell into dropdown
list with 6 options
(table cell has its id)
Is it possible to do it in similar way?

Yes, but use new Option():

<URL:
http://groups.google.com.au/group/c...ox,+opera,+but+not+ie&rnum=1#c1b346a2775d8511
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top