OK, I hope the answer to this is 'do it this way or that way noob!'

I make this statement while in a loop:
$( ("#audioin"+i) ).bind("change", { roomnum: roomindex, itemid:i,
member:'audioin'  }, updateItem);

// roomindex, i, and audioin are known-good vars with values.

my function:
function updateItem(e){

        var membername =   e.data.member;
        var roomnumber = e.data.roomnum;
        var itemnumber = e.data.itemid;

        if(this.type == "checkbox"){
               //project is a known-good global object Im using
                project.rooms[roomnumber ].products[ itemnumber ].membername =
this.checked;
        }else{
            //i think my operator precedence is wrong here, but
still...
        
project.rooms[ e.data.roomnum ].products[ e.data.itemid ].membername =
this.value;
        }
}

There is something wrong with the datatype of e.data.member , and
roomnum, and itemid. If I hardcode this statement:
project.rooms[3].products[4].videoin = 1;   then it works fine and my
value sticks in the global object member.

I can alert e.data.member, roomnum, and itemid, and they 'appear' to
be right. but they wont work.

Please can someone show me how I need to treat the e.data so my
statement works properly?

Thanks in advance for any help you can offer.

DE






Reply via email to