Select a row and go! Please help?

This is a discussion on "Select a row and go! Please help?" within the JavaScript Forum section. This forum, and the thread "Select a row and go! Please help? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 11th, 2005, 16:32
New Member
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Select a row and go! Please help?

I can't understand what I'm doing wrong this this if else statement, if I take out the else, the function works (someone helped me with that too)
I need to check the objects classname, if it's white, then set the background to white, if it's gray set the background to gray, but if it's clicked (selected) set the background to another color.
here's the code:
Code: Select all
  <script>
 function TouchIt(location,id){
 
  var cells = new Array();
  cells[0] = 'doc1';
  cells[1] = 'doc2';
 
  for (i=0;i<cells.length;i++)
  {
   if (document.getElementById(cells[i]).style.backgroundColor == "white"){
    document.getElementById(cells[i]).style.backgroundColor = "white";
   } else {
   document.getElementById(cells[i]).style.backgroundColor = "#e6e6e6";
 }
 
  document.getElementById(id).style.backgroundColor = "#FDBD78";
  document.getElementById('MyForm').action = location;
 }
 </script>
any help would be appreciated, I feel so stupid for not being able to figure out yet another simple javascript problem
Reply With Quote

  #2 (permalink)  
Old Nov 16th, 2005, 15:50
Banned Member
Join Date: Sep 2005
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Select a row and go! Please help?

1. background coler oenlee appli tu a object yu kan see on the skreen...not tu a javascript varabel.
2. if yu yuze a drop box, the selected box automatik get blue so it stand out from all other boxes.
3. Yu kan make a tabel with a bunch av boxes, all with the same name. Then yuze onFocus or onMouseOver tu chaenj its background koler.
Tu be konsistant, put same kode for all boxes
onmouseover=koler1
onmouseout =koler2.
4. yu kan name all the boxes with the same name, then yu kan
yuze getelementbyid on em & yuze javascript tu chaenj the backgound koler.
Reply With Quote
Reply

Tags
select, row, help

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
chained select box dependable select thenamenoonehastaken JavaScript Forum 0 Feb 8th, 2008 05:49
Select from many tables! kool77 Databases 2 May 30th, 2007 20:09
Help Please Select Max Not Working rosh1e PHP Forum 3 May 13th, 2007 19:11
CSS and select djme Web Page Design 1 Mar 2nd, 2006 02:05
SELECT statement gecastill Databases 1 Feb 15th, 2006 23:27


All times are GMT. The time now is 00:09.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43