Tabel Cell

  • Thread starter Thread starter gmalai
  • Start date Start date
G

gmalai

Hi,

I would like to know if it is possible to add a text box in table cell
if I **double-click** in that particular table cell(the table was
generated at runtime). If so, could you please give some helpful hints
as to how to proceed.

Thanks,

Gayathri
 
Hi,

I had never tried like this but i think it is possible using following way

1. While generating the table also generate the textboxes with visibility
hidden.

2. Generate ID of each cell and its text box in such a way e.g
for table cell say "TD1" for the respective Textbox say "TD1_txt" or
somthing similar

3. Create a javascript function which is called when you double click on the
cell, when you know the cell id, you can easily get an object reference for
text box by using eval function, set its visibility to visible.

4. you can also have another function for hiding inactive textboxes, which
can be called on obblur event of textbox.

5. Once you are done entering the value in the textbox, you can use
innerText property of cell to sync values.

HTH
 
Back
Top