innerHTML for a table row problem



I am having trouble with the following function that I am modifying
from www.isocra.com. I am trying to change the ID of a hidden form
object inside a table row. I have used alert() to test where it breaks
and it seems to be on the last line of the function where I am trying
to place the new text back into the table row. Anyone any ideas where
I a going wrong as I'm not a great Javascript coder.

Thanks in advance.

this.onDrop = function(table, droppedRow) {
var rows = table.tBodies[0].rows;
var rowsCount = parseInt(rows.length);

for (var x = 0; x <= rowsCount - 1; x++)
{
//Get string contents of row
var curRowString = rows[x].innerHTML;

//Find where ID tag is
var IDStart = curRowString.indexOf("ID");

//Find > immediately after ID tag
var IDEnd = curRowString.indexOf(">", IDStart);

//Get ID value
var IDVal = curRowString.substring(IDStart+5,IDEnd)

//Replace old ID with new ID
var oldID = "ID" + IDVal;
var newID = "ID" + (x+1);
var newRowString = curRowString.replace(oldID, newID);

//*********** Crashes on line below ***************
rows[x].innerHTML = newRowString;
}
}

.



Relevant Pages

  • Re: innerHTML for a table row problem
    ... I am trying to change the ID of a hidden form ... //Find> immediately after ID tag ... var IDVal = curRowString.substring ... then iterate over the returned collection to find what you ...
    (comp.lang.javascript)
  • Re: Help needed for a expand-collapse menu
    ... function getParentByTag(element, tag) { ... var div = getParentByTag; ... if (!div) return; // Fail silently ... so I need help with the collapse part and this is how I would like to ...
    (comp.lang.javascript)
  • Re: Pop Up bookmark in hotspot
    ... Remove All the code you pasted in the hyperlink tag and paste it in the HEAD section as ... var title="YOURWEBSITE DESCRIPTION "; ... | the little box that says "Bookmark this Page" and then opens up the viewer's ... | | the answers I got were good - however when I draw the hotspot in the ...
    (microsoft.public.frontpage.client)
  • Re: Get ID-Tags of MP3s
    ... {- Fixed bug with tag ... {ID3v2 frame header} ... function ExtractTrack(const TrackString: string): Byte; ...
    (comp.lang.pascal.delphi.misc)
  • Re: Get ID-Tags of MP3s
    ... {- Fixed bug with tag ... {ID3v2 frame header} ... function ExtractTrack(const TrackString: string): Byte; ...
    (alt.comp.lang.borland-delphi)