Help to restrict user not to change color of multiple rows 
Author Message
 Help to restrict user not to change color of multiple rows

Hi All,

I have javascript codes that allow user to change row color and return
to its original color when they click the same row again. It works
fine, but now I'd like to modify this code so they can only have one
row color being changed at a time (no multiple selection). Can
somebody give me a direction ???

Thanks, Andie.

<SCRIPT language=javascript>

function changeColor(element)
{
  var origColor, undefined;

  origColor = element.style.oldcolor;

  if ( (origColor == undefined) || (origColor.length == 0) )
  {
    origColor = element.style.backgroundColor;
    lastOrigColor = origColor;
    element.style.backgroundColor = "#FDFAD0";
    element.style.oldcolor = origColor;
  }
  else {
    element.style.backgroundColor = origColor;
    element.style.oldcolor = "";
  }    

Quote:
}  

</script>

</head>

<TABLE border=1 cellPadding=1 cellSpacing=1 width="75%">
    <tr id='row1' onclick='changeColor(this);'
STYLE="background-color:'#EEEEEE'; cursor:hand">
        <td>blah</td>
        <td>blah</td>
        <td>blah</td>
    </tr>
    <tr id='row2' onclick='changeColor(this);'
STYLE="background-color:'#FFFFFF'; CURSOR: hand">
        <td>blah</td>
        <td>blah</td>
        <td>blah</td>
    </tr>
    <tr id='row3' onclick='changeColor(this);'
STYLE="background-color:'#EEEEEE'; cursor:hand">
        <td>blah</td>
        <td>blah</td>
        <td>blah</td>
    </tr>
    <tr id='row4' onclick='changeColor(this);'
STYLE="background-color:'#FFFFFF'; CURSOR: hand">
        <td>blah</td>
        <td>blah</td>
        <td>blah</td>
    </tr>

</table>



Mon, 28 Feb 2005 05:38:13 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Help with Multiple Row Color Change

2. changing td color for entire row on mouseover

3. Change row color to its original bgcolor

4. Color Changing in rows of HTML table.

5. Changing row contents (not cell contents)

6. table row text will not show after row insert

7. How to change cell color or font color when data changed

8. Restrict No Of Users

9. How do I restrict Netscape users from browsing my page

10. Restricting users to a website

11. Applying profile changes to user who is not logged in

12. list all users who have not changed passwords in 60 days

 

 
Powered by phpBB® Forum Software