Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: TABLE HELP


Message #1 by "Fagan, Karen A (ARINC)" <FaganKA@n...> on Fri, 1 Nov 2002 10:51:46 -0500
Hi everyone,
   

      Can anyone tell me if it's possible to let a user change the
background color of a cell in a table on a webpage?  If so can someone tell
me how.

      This is what I'm trying to do:  I have a table on a webpage, 1 of the
columns named Status will be colored coded to shows user at a glance the
status of a machine.  Ex:  	Green - ok
	Yellow- unstable
	Red- system is down

     I need for the System Administrators to be able to change the color
depending ont he status of the machine.  I am a newbie and any help would be
greatly appreicated.



Thanks so much,

Karen
Message #2 by "Stephan Bussing" <Stephan_bussing@h...> on Fri, 1 Nov 2002 18:43:17
Hi Karen,

as I understand it right, you have a part of a website that's shown to the 
user and an other part which is stricktly for administrators. Will the 
status of a machine be retreived from a database? In that case it's easy, 
just use a case statement like:

Dim strBackgroundColor : strBackgroundColor = "Green" 'Default color

Select Case rsRecordset("fieldname") (in this case it might be "status")
Case "unstable"
 strBackgroundColor = "yellow"
Case "down"
  strBackgroundColor = "red"
End Select

Then parse this value through to your table

"<table><tr><td sytle='" & strBackgroundColor & "'>system 
status</td></tr></table>"

Something like that. 

I'll hope it will be of some help

Greetzzzz


> Hi everyone,
   

      Can anyone tell me if it's possible to let a user change the
background color of a cell in a table on a webpage?  If so can someone tell
me how.

      This is what I'm trying to do:  I have a table on a webpage, 1 of the
columns named Status will be colored coded to shows user at a glance the
status of a machine.  Ex:  	Green - ok
	Yellow- unstable
	Red- system is down

     I need for the System Administrators to be able to change the color
depending ont he status of the machine.  I am a newbie and any help would 
be
greatly appreicated.



Thanks so much,

Karen
Message #3 by "Drew, Ron" <RDrew@B...> on Fri, 1 Nov 2002 16:02:02 -0500
The first highlights the item in total.  The second just does it based
on the checkbox.  Use them if you can.

<head>
<script LANGUAGE=3D"JavaScript">
<!--
	function TR_OnMouseOver(srcEle) {
		TempColor =3D srcEle.style.backgroundColor;
		srcEle.style.backgroundColor =3D "teal";
	}

	function TR_OnMouseOut(srcEle) {
		srcEle.style.backgroundColor =3D TempColor;
	}
-->
</script>
</HEAD>
<tr onmouseover=3D"TR_OnMouseOver(this);"
onmouseout=3D"TR_OnMouseOut(this);">

...................or  second.............................

<SCRIPT LANGUAGE=3D"JavaScript">
function inspectbox(){
for (var i =3D 0; i < 5; i++){
if (document.form1.kies[i].checked){
   document.all.rij[i].bgColor =3D "E9C2A6"
   }
else
  {
   document.all.rij[i].bgColor =3D "FFFFFF"
   }
 }
}
</SCRIPT>
 <input type=3D"checkbox" name=3D"kies" value=3D"checkbox"
onClick=3D"inspectbox()"></td>

Good luck

-----Original Message-----
From: Fagan, Karen A (ARINC) [mailto:FaganKA@n...]
Sent: Friday, November 01, 2002 10:52 AM
To: ASP Databases
Subject: [asp_databases] TABLE HELP


Hi everyone,
  

      Can anyone tell me if it's possible to let a user change the
background color of a cell in a table on a webpage?  If so can someone
tell me how.

      This is what I'm trying to do:  I have a table on a webpage, 1 of
the columns named Status will be colored coded to shows user at a glance
the
status of a machine.  Ex:  	Green - ok
	Yellow- unstable
	Red- system is down

     I need for the System Administrators to be able to change the color
depending ont he status of the machine.  I am a newbie and any help
would be greatly appreicated.



Thanks so much,

Karen

Message #4 by "Fagan, Karen A (ARINC)" <FaganKA@n...> on Tue, 12 Nov 2002 15:36:01 -0500
Hi Stephan,

    Your answer looks like it might be what I'm looking for.  I do not have
the info in a database at this time, but 
it is not a problem to do so.

    As I mentioned I am pretty new to this and I know there are several ways
to do the same thing, so I am a little confused
as to how this exactly would work. I think my confusion is in getting the
info out into the table.

    If you could give any further help, I would appreciate it very much.

Thank you
Karen

   

-----Original Message-----
From: Stephan Bussing [mailto:Stephan_bussing@h...]
Sent: Friday, November 01, 2002 1:43 PM
To: ASP Databases
Subject: [asp_databases] Re: TABLE HELP


Hi Karen,

as I understand it right, you have a part of a website that's shown to the 
user and an other part which is stricktly for administrators. Will the 
status of a machine be retreived from a database? In that case it's easy, 
just use a case statement like:

Dim strBackgroundColor : strBackgroundColor = "Green" 'Default color

Select Case rsRecordset("fieldname") (in this case it might be "status")
Case "unstable"
 strBackgroundColor = "yellow"
Case "down"
  strBackgroundColor = "red"
End Select

Then parse this value through to your table

"<table><tr><td sytle='" & strBackgroundColor & "'>system 
status</td></tr></table>"

Something like that. 

I'll hope it will be of some help

Greetzzzz


> Hi everyone,
   

      Can anyone tell me if it's possible to let a user change the
background color of a cell in a table on a webpage?  If so can someone tell
me how.

      This is what I'm trying to do:  I have a table on a webpage, 1 of the
columns named Status will be colored coded to shows user at a glance the
status of a machine.  Ex:  	Green - ok
	Yellow- unstable
	Red- system is down

     I need for the System Administrators to be able to change the color
depending ont he status of the machine.  I am a newbie and any help would 
be
greatly appreicated.



Thanks so much,

Karen
Message #5 by "Drew, Ron" <RDrew@B...> on Tue, 12 Nov 2002 15:48:42 -0500
Maybe something like this....cut it and paste it and give it a
try...change the hex color

<html>
<head>
<title>checkboxcolor2</title>
<meta http-equiv=3D"Content-Type" content=3D"text/html; 
charset=3Diso-8859-1">

<SCRIPT LANGUAGE=3D"JavaScript">
function inspectbox(){
for (var i =3D 0; i < 5; i++){
if (document.form1.kies[i].checked){
   document.all.rij[i].bgColor =3D "E9C2A6"
   }
else
  {
   document.all.rij[i].bgColor =3D "FFFFFF"
   }
 }
}
</SCRIPT>
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
<form name=3D"form1" method=3D"post" action=3D"">
  <table width=3D"50%" border=3D"0" cellspacing=3D"2">
    <tr ID=3D"rij"><td width=3D"12%">
     <input type=3D"checkbox" name=3D"kies" value=3D"checkbox"
onClick=3D"inspectbox()"></td>
     <td width=3D"88%">checkbox1</td>
    </tr>
    <tr ID=3D"rij"><td width=3D"12%">
     <input type=3D"checkbox" name=3D"kies" value=3D"checkbox"
onClick=3D"inspectbox()"></td>
      <td width=3D"88%">checkbox2</td>
    </tr>
    <tr ID=3D"rij">
      <td width=3D"12%">
        <input type=3D"checkbox" name=3D"kies" value=3D"checkbox"
onClick=3D"inspectbox()">
      </td>
      <td width=3D"88%">checkbox3</td>
    </tr>
    <tr ID=3D"rij">
      <td width=3D"12%">
        <input type=3D"checkbox" name=3D"kies" value=3D"checkbox"
onClick=3D"inspectbox()">
      </td>
      <td width=3D"88%">checkbox4</td>
    </tr>
    <tr ID=3D"rij">
      <td width=3D"12%">
        <input type=3D"checkbox" name=3D"kies" value=3D"checkbox"
onClick=3D"inspectbox()">
      </td>
      <td width=3D"88%">checkbox5</td>
    </tr>
  </table>
</form>
</body>
</html>

-----Original Message-----
From: Fagan, Karen A (ARINC) [mailto:FaganKA@n...]
Sent: Tuesday, November 12, 2002 3:36 PM
To: ASP Databases
Subject: [asp_databases] Re: TABLE HELP


Hi Stephan,

    Your answer looks like it might be what I'm looking for.  I do not
have the info in a database at this time, but
it is not a problem to do so.

    As I mentioned I am pretty new to this and I know there are several
ways to do the same thing, so I am a little confused as to how this
exactly would work. I think my confusion is in getting the info out into
the table.

    If you could give any further help, I would appreciate it very much.

Thank you
Karen

  

-----Original Message-----
From: Stephan Bussing [mailto:Stephan_bussing@h...]
Sent: Friday, November 01, 2002 1:43 PM
To: ASP Databases
Subject: [asp_databases] Re: TABLE HELP


Hi Karen,

as I understand it right, you have a part of a website that's shown to
the
user and an other part which is stricktly for administrators. Will the
status of a machine be retreived from a database? In that case it's
easy,
just use a case statement like:

Dim strBackgroundColor : strBackgroundColor =3D "Green" 'Default color

Select Case rsRecordset("fieldname") (in this case it might be "status")
Case "unstable"  strBackgroundColor =3D "yellow" Case "down"
  strBackgroundColor =3D "red"
End Select

Then parse this value through to your table

"<table><tr><td sytle=3D'" & strBackgroundColor & "'>system
status</td></tr></table>"

Something like that.

I'll hope it will be of some help

Greetzzzz


> Hi everyone,
  

      Can anyone tell me if it's possible to let a user change the
background color of a cell in a table on a webpage?  If so can someone
tell me how.

      This is what I'm trying to do:  I have a table on a webpage, 1 of
the columns named Status will be colored coded to shows user at a glance
the
status of a machine.  Ex:  	Green - ok
	Yellow- unstable
	Red- system is down

     I need for the System Administrators to be able to change the color
depending ont he status of the machine.  I am a newbie and any help
would
be
greatly appreicated.



Thanks so much,

Karen


  Return to Index