This is slowly driving me insane .. you would think this would be an easy
thing to do (what I'm trying to accomplish, not driving me insane =-p )

I have a table with dynamicly generated rows.  Each row has 2 cells.  The
first cell in each row has an ID.  When a row is clicked it triggers a
JavaScript function and passes the ID of the first cell to it.  When this
happens, I want the function to change the background color of the first
cell.  Here is what I have so far:

function addStudentToList(studentPK) {

    tdID = "id" + studentPK;

    if (studentList.Item(studentPK) == studentPK) {
        studentList.Remove(studentPK);
        document.all.tdID.runtimeStyle.backgroundColor =
document.all.tdID.style.backgroundColor;
    }
    else {
        studentList.Item(studentPK) = studentPK;
        document.all.tdID.runtimeStyle.backgroundColor = "yellow";
    }
}

tdID is the variable that contains the ID of the first cell.  It looks
something like "id38", etc.  How do I get JavaScript to evaluate tdID into
its true value and not think that I'm refering to an object named tdID?

Anyone?

Todd



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to