Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 11th, 2005, 03:09 PM
Mexican Ninja Mexican Ninja is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Kaneohe, Hawaii, USA
Posts: 36 Mexican Ninja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to Mexican Ninja
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
  1.  
  2. function checkSeat(theSeat,theAction)
  3. {
  4.     <!-- var currentColor = theSeat.getAttribute('bgcolor'); -->
  5.    
  6.     var currentStatus = theSeat.getAttribute('title');
  7.     var currentClass = theSeat.getAttribute('className');
  8.    
  9.     if(theAction == 'click')
  10.     {
  11.         if( currentStatus == 'Open') // Its open, change bg to selected
  12.         {
  13.         theSeat.setAttribute('title', 'Selected',1);
  14.         theSeat.setAttribute('class', 'OpenSelected',1);
  15.        
  16.         document.seatSelection.thingsSelected.value += theSeat.getAttribute('data') + "n";
  17.         }
  18.         else if( currentColor == 'Selected') //Unclick back to regular.
  19.         {
  20.         theSeat.setAttribute('title', 'Open',1);
  21.         theSeat.setAttribute('class', 'Open',1);
  22.         }
  23.     }
  24.     else if(theAction == 'over')
  25.     {
  26.         if( currentStatus == 'Open') // Its open, change bg to selected
  27.         {
  28.         theSeat.setAttribute('class', 'OpenOver',1);
  29.         }
  30.         else if( currentStatus == 'Selected') //Unclick back to regular.
  31.         {
  32.         theSeat.setAttribute('class', 'OpenSelected',1);
  33.         }
  34.     }
  35.     else if(theAction == 'out')
  36.     {
  37.         if( currentStatus == 'Open') // Its open, change bg to selected
  38.         {
  39.         theSeat.setAttribute('class', 'Open',1);
  40.         }
  41.         else if( currentStatus == 'Selected',1) //Unclick back to regular.
  42.         {
  43.         theSeat.setAttribute('class', 'OpenSelected',1);
  44.         }
  45.     }
  46. }
  47.  


Any ideas?

Reply With Quote
  #2  
Old April 11th, 2005, 10:10 PM
pickleman78 pickleman78 is offline
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Dallas,TX,USA
Posts: 582 pickleman78 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to pickleman78
RE: Obtaining Text/Data from a Table Cell

If its just text inside the table cell (I think I read that right, I assume by cell you mean a <td>?)

document.getElementById("tdid").innerHTML;

That should give you the HTML between <td> and </td>

Reply With Quote
  #3  
Old April 12th, 2005, 02:53 AM
Mexican Ninja Mexican Ninja is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Kaneohe, Hawaii, USA
Posts: 36 Mexican Ninja User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to Mexican Ninja
RE: Obtaining Text/Data from a Table Cell

hmm....thats what i pretty much did in the end...execept for that .innerhtml command. thanks for response though!

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Obtaining Text/Data from a Table Cell


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT