Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 29th, 2005, 08:27 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default change style.backgroundColor the reset all others

Code:
function colour(el_id)
{
    //alert("FUNCTION: colour");
    var el = document.getElementById(el_id);    
    el.style.backgroundColor = "#E2E6ED";

}

<td id="ADTcell:<%=x%>">
    <%
    'response.Write "x = " & x & "<br>"
    'response.Write "noc = " & noc & "<br>"
    if CInt(x) <= CInt(noa) then
    'response.Write "<h4>linie 724</h4>"
    %>    
    <input type="radio" name="pass" id="adt<%=x%>" onMouseOver="style.cursor='hand'" onClick="return colour('ADTcell:<%'=x%>');" />
    <%
    else
    response.Write "&nbsp;"
    end if
    %>
    </td>
Is there a way i can have only one cell highlighted at any one time? So that when one cell is changed to #E2E6ED then all other cells are changed to #FFFFFF?

TIA.

Picco


www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
Reply With Quote
  #2 (permalink)  
Old September 29th, 2005, 08:58 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Yes, onmouseover assign a background colour to the table as a whole, or if you prefer loop through the table.rows and assign a background colour to each row. Then assign the target cell its own colour. When onmouseout fires set the whole table back to its original colour.

--

Joe
Reply With Quote
  #3 (permalink)  
Old September 29th, 2005, 09:52 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

Code:
    <table border="1" bordercolor="#000000" id="passSel">
    <tr class="mainFnt">
    <td>&nbsp;</td>
    <td>Adult</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>    
    </tr>
    <% for x = 1 to noa %>
    <tr class="mainFnt">
    <td id="ADTcell:<%=x%>">
    <%
    'response.Write "x = " & x & "<br>"
    'response.Write "noc = " & noc & "<br>"
    if CInt(x) <= CInt(noa) then
    'response.Write "<h4>linie 724</h4>"
    %>    
    <input type="radio" name="pass" id="adt<%=x%>" onMouseOver="style.cursor='hand'" onClick="document.form.activePass.value=this.id;" />
    <%
    else
    response.Write "&nbsp;"
    end if
    %>
    </td>
    <td><%=x%></td>
    <td id="adtfname<%=x%>">adtfname</td>
    <td id="adtlname<%=x%>">adtlname</td>
    </tr>
    <% next %>


    <tr>
    <td colSpan="<%=cols%>" align="center">        
    <input type="button" name="Submit" value="Hold Seat" onclick="javascript: chkFrm('<%=seg%>');"
    STYLE="font-weight : bold; color: #064a6d; font-size : 10; text-align : center;" />    
    </td>
    </tr>    
    </table>
how do i build that into my function? that is my table.

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic change of style rajesh_css Javascript 3 October 10th, 2008 04:45 AM
Change Drop down Border style ismailc XSLT 2 December 10th, 2007 07:25 AM
Change C# application Visual Style niting85 .NET Framework 2.0 0 April 30th, 2007 03:27 AM
!resolved! - a change in coding style grimmy PHP How-To 1 June 27th, 2004 10:21 AM



All times are GMT -4. The time now is 05:36 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.