
April 11th, 2005, 03:09 PM
|
|
|
|
Join Date: Apr 2007
Location: Kaneohe, Hawaii, USA
Posts: 36
Time spent in forums: < 1 sec
Reputation Power: 2
|
|
|
Obtaining Text/Data from a Table Cell
I was wondering what the Javascript coding for obtaining data with in a cell is? What i am trying to do is obtain the data from the cell and place it into a list field box, so the user can click on the cell and add as many cell data as possible.
document.seatSelection.thingsSelected.value is the target list box.
setAttribute('title', 'Open',1);
Syntax for this means: the attributed wanted to change, what you want it changed to, and if it is case sensative. (for you wondering people!)
My problem is pulling the the data from a formed table and copying it into the list box.
I have seen something about indexing the
What i have:
php Code:
Original
- php Code |
|
|
|
function checkSeat(theSeat,theAction) { <!-- var currentColor = theSeat.getAttribute('bgcolor'); --> var currentStatus = theSeat.getAttribute('title'); var currentClass = theSeat.getAttribute('className'); if(theAction == 'click') { if( currentStatus == 'Open') // Its open, change bg to selected { theSeat.setAttribute('title', 'Selected',1); theSeat.setAttribute('class', 'OpenSelected',1); document.seatSelection.thingsSelected.value += theSeat.getAttribute('data') + "n"; } else if( currentColor == 'Selected') //Unclick back to regular. { theSeat.setAttribute('title', 'Open',1); theSeat.setAttribute('class', 'Open',1); } } else if(theAction == 'over') { if( currentStatus == 'Open') // Its open, change bg to selected { theSeat.setAttribute('class', 'OpenOver',1); } else if( currentStatus == 'Selected') //Unclick back to regular. { theSeat.setAttribute('class', 'OpenSelected',1); } } else if(theAction == 'out') { if( currentStatus == 'Open') // Its open, change bg to selected { theSeat.setAttribute('class', 'Open',1); } else if( currentStatus == 'Selected',1) //Unclick back to regular. { theSeat.setAttribute('class', 'OpenSelected',1); } } }
Any ideas?
|