Forum Moderators: open

Message Too Old, No Replies

Dynamic cell - id

         

Tatvagna

1:26 pm on Apr 25, 2007 (gmt 0)

10+ Year Member



Hello All,

I have a page in which i have used


document.form.TV_ExcRep_1_7.style.background = "rgb(230,250,125)";

here the TV_ExcRep_1_7 is my cell id of a table(SAP-BSP tableView)...!

Now i need to change the value of cellid dynamically...

So i wrote a small JS function(i admit i don't know the JS code very nicely..!)

but how do i concatenate the 'cellid' in


document.form.TV_ExcRep_1_7.style.background = "rgb(230,250,125)";

Thanks in advance...!

Dabrowski

1:36 pm on Apr 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cell id of a table

I'm not sure what you mean by this, if you mean it's TD, inside a TABLE then you can't access it with document.form.

Generally to access an element by ID you'd do this:

var myElem = document.getElementById( "myID");

myElemt.style.background = "rgb(230,250,125)";

Not sure where you want the string concat, but in JS you just 'add' strings together, e.g. "my" + "ID" would give you "myID".