473,396 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Change colour of text when webpage updates

Afternoon all,

I have a Web based Sales tracker that sales agents sumbitted information onto a web page that then goes into an Access database, using ASP Javascript and/or VBScript

I have webpages that are linked to Access queries that show the volumes of sales by agent, for example

Name Sales

Agent1 5
Agent2 3
Agent3 1

Then once the webpage is refreshed (so it re runs the query in access) it displayed this:

Name Sales

Agent1 6
Agent2 4
Agent3 1

Agent1 and Agent2 flash a different colour to show that they have added a new sale

Really hope that makes sense

Can anyone help

Massive Thanks
May 30 '12 #1
3 2297
CroCrew
564 Expert 512MB
I think we can help. But, first what code have you got for the page so that we can build off of it.

Happy Coding,
CroCrew~
Jun 26 '12 #2
Here is a copy of the code

It's the Sales Column I want to flash a colour when it changes. Really appreciate your help

Thanks

Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
  2. <!--#include file="../Connections/database1.asp" -->
  3. <%
  4. Dim Totals__MMColParam
  5. Totals__MMColParam = "Steven Thomas"
  6. If (Request("MM_EmptyValue") <> "") Then 
  7.   Totals__MMColParam = Request("MM_EmptyValue")
  8. End If
  9. %>
  10. <%
  11. Dim Totals
  12. Dim Totals_cmd
  13. Dim Totals_numRows
  14.  
  15. Set Totals_cmd = Server.CreateObject ("ADODB.Command")
  16. Totals_cmd.ActiveConnection = MM_database1_STRING
  17. Totals_cmd.CommandText = "SELECT * FROM QryWallboardTeamPremiums WHERE Team = ?" 
  18. Totals_cmd.Prepared = true
  19. Totals_cmd.Parameters.Append Totals_cmd.CreateParameter("param1", 200, 1, 50, Totals__MMColParam) ' adVarChar
  20.  
  21. Set Totals = Totals_cmd.Execute
  22. Totals_numRows = 0
  23. %>
  24. <%
  25. Dim Recordset2__MMColParam
  26. Recordset2__MMColParam = "Steven Thomas"
  27. If (Request("MM_EmptyValue") <> "") Then 
  28.   Recordset2__MMColParam = Request("MM_EmptyValue")
  29. End If
  30. %>
  31. <%
  32. Dim Recordset2
  33. Dim Recordset2_cmd
  34. Dim Recordset2_numRows
  35.  
  36. Set Recordset2_cmd = Server.CreateObject ("ADODB.Command")
  37. Recordset2_cmd.ActiveConnection = MM_database1_STRING
  38. Recordset2_cmd.CommandText = "SELECT * FROM QryWallboardbyAgentPremiums5 WHERE Team = ? ORDER BY Conversion DESC" 
  39. Recordset2_cmd.Prepared = true
  40. Recordset2_cmd.Parameters.Append Recordset2_cmd.CreateParameter("param1", 200, 1, 50, Recordset2__MMColParam) ' adVarChar
  41.  
  42. Set Recordset2 = Recordset2_cmd.Execute
  43. Recordset2_numRows = 0
  44. %>
  45. <%
  46. Dim TotalCallsbyTeam__MMColParam
  47. TotalCallsbyTeam__MMColParam = "Steven Thomas"
  48. If (Request("MM_EmptyValue") <> "") Then 
  49.   TotalCallsbyTeam__MMColParam = Request("MM_EmptyValue")
  50. End If
  51. %>
  52. <%
  53. Dim TotalCallsbyTeam
  54. Dim TotalCallsbyTeam_cmd
  55. Dim TotalCallsbyTeam_numRows
  56.  
  57. Set TotalCallsbyTeam_cmd = Server.CreateObject ("ADODB.Command")
  58. TotalCallsbyTeam_cmd.ActiveConnection = MM_database1_STRING
  59. TotalCallsbyTeam_cmd.CommandText = "SELECT SumOfNumberofCalls FROM QryTotalNumberofCallsbyTeam WHERE Team = ?" 
  60. TotalCallsbyTeam_cmd.Prepared = true
  61. TotalCallsbyTeam_cmd.Parameters.Append TotalCallsbyTeam_cmd.CreateParameter("param1", 200, 1, 50, TotalCallsbyTeam__MMColParam) ' adVarChar
  62.  
  63. Set TotalCallsbyTeam = TotalCallsbyTeam_cmd.Execute
  64. TotalCallsbyTeam_numRows = 0
  65. %>
  66. <%
  67. Dim TeamConversion__MMColParam
  68. TeamConversion__MMColParam = "Steven Thomas"
  69. If (Request("MM_EmptyValue") <> "") Then 
  70.   TeamConversion__MMColParam = Request("MM_EmptyValue")
  71. End If
  72. %>
  73. <%
  74. Dim TeamConversion
  75. Dim TeamConversion_cmd
  76. Dim TeamConversion_numRows
  77.  
  78. Set TeamConversion_cmd = Server.CreateObject ("ADODB.Command")
  79. TeamConversion_cmd.ActiveConnection = MM_database1_STRING
  80. TeamConversion_cmd.CommandText = "SELECT CountOfMediaRoute FROM QryConversionInboundTeam WHERE Team = ?" 
  81. TeamConversion_cmd.Prepared = true
  82. TeamConversion_cmd.Parameters.Append TeamConversion_cmd.CreateParameter("param1", 200, 1, 50, TeamConversion__MMColParam) ' adVarChar
  83.  
  84. Set TeamConversion = TeamConversion_cmd.Execute
  85. TeamConversion_numRows = 0
  86. %>
  87. <%
  88. Dim Repeat2__numRows
  89. Dim Repeat2__index
  90.  
  91. Repeat2__numRows = -1
  92. Repeat2__index = 0
  93. Recordset2_numRows = Recordset2_numRows + Repeat2__numRows
  94. %>
  95. <%
  96. Dim Repeat1__numRows
  97. Dim Repeat1__index
  98.  
  99. Repeat1__numRows = -1
  100. Repeat1__index = 0
  101. DSSales_numRows = DSSales_numRows + Repeat1__numRows
  102. %>
  103. <% on error resume next%>
  104. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  105. <html xmlns="http://www.w3.org/1999/xhtml">
  106. <head>
  107. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  108. <title>Steven Thomas Wallboard</title>
  109. <style type="text/css">
  110. <!--
  111. .style1 {
  112.     font-size: 18px;
  113.     font-weight: bold;
  114. }
  115. .style2 {
  116.     color: #FFFFFF;
  117.     font-weight: bold;
  118. }
  119. -->
  120. </style>
  121.  
  122. <style type="text/css">
  123. <!--
  124. .style3 {
  125.     font-size: 12px;
  126.     font-weight: bold;
  127. }
  128. .style4 {font-size: 12px}
  129. .style8 {font-size: 14; font-weight: bold; }
  130. .style11 {font-size: 10px}
  131. -->
  132. </style>
  133. </head>
  134.  
  135. <body>
  136. <div align="center">
  137.   <p class="style1">Steven Thomas Wallboard </p>
  138. </div>
  139. <div align="center">
  140.   <table centre border="1">
  141.     <tr>
  142.       <td bordercolor="#FFFFFF" bgcolor="#FF0000"><div align="center" class="style2">AgentName</div></td>
  143.       <td bordercolor="#FFFFFF" bgcolor="#FF0000"><div align="center" class="style2">Calls</div></td>
  144.       <td bordercolor="#FFFFFF" bgcolor="#FF0000"><div align="center" class="style2">
  145.         <div align="center">Sales</div>
  146.       </div></td>
  147.       <td bordercolor="#FFFFFF" bgcolor="#FF0000"><div align="center" class="style2">Conversion</div></td>
  148.     </tr>
  149.     <% 
  150. While ((Repeat2__numRows <> 0) AND (NOT Recordset2.EOF)) 
  151. %>
  152.         <tr>
  153.           <td><div align="center"><span class="style3 style4"><%=(Recordset2.Fields.Item("FriendlyName").Value)%></span></div></td>
  154.           <td><div align="center">
  155.               <div align="center"><span class="style3"><%=(Recordset2.Fields.Item("Calls").Value)%></span></div></td>
  156.           <td class="style8"><div align="center"><span class="style3"><%=(Recordset2.Fields.Item("Sales").Value)%></span></div></td>
  157.           <td class="style8">
  158.           <div align="center">
  159.           <div align="center"><%= FormatPercent((Recordset2.Fields.Item("Conversion").Value), 2, -2, -2, -2) %></div></td>
  160.         </tr>
  161. <% 
  162.   Repeat2__index=Repeat2__index+1
  163.   Repeat2__numRows=Repeat2__numRows-1
  164.   Recordset2.MoveNext()
  165. Wend
  166. %>
  167. <tr>
  168.         <td height="23"><div align="center" class="style3">
  169.           <div align="center">Totals</div>
  170.         </div></td>
  171.         <td><div align="center"><span class="style3"> <%=(TotalCallsbyTeam.Fields.Item("SumOfNumberofCalls").Value)%> </span></div></td>
  172.         <td><div align="center"><span class="style3"><%=(Totals.Fields.Item("Total of MediaRoute").Value)%></span></div></td>
  173.         <td><div align="center"><strong class="style8"><%= FormatNumber(((Totals.Fields.Item("Total of MediaRoute").Value)) / ((TotalCallsbyTeam.Fields.Item("SumOfNumberofCalls").Value)/100), 2, -2, -2, -2)%>%</strong></div></td>
  174.     </tr>
  175.   </table>
  176.   <form id="form1" name="form1" method="post" action="">
  177.     <p class="style1">&nbsp;</p>
  178.     <p>&nbsp;</p>
  179.   </form>
  180.   <p><img src="http://bytes.com/topic/asp-classic/images/LSGlogoWallboard.gif" alt="LSG" width="124" height="100" /></p>
  181. </div>
  182. <div align="center"></div>
  183. </body>
  184. </html>
  185. <%
  186. Totals.Close()
  187. Set Totals = Nothing
  188. %>
  189. <%
  190. Recordset2.Close()
  191. Set Recordset2 = Nothing
  192. %>
  193. <%
  194. TotalCallsbyTeam.Close()
  195. Set TotalCallsbyTeam = Nothing
  196. %>
  197. <%
  198. TeamConversion.Close()
  199. Set TeamConversion = Nothing
  200. %>
Aug 15 '12 #3
Rabbit
12,516 Expert Mod 8TB
The page should make an AJAX call to get updated information. You can then use javascript to compare the old value against the new value retreived with AJAX.
Aug 15 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Reply Via Newsgroup | last post by:
Folks, Say I have a table, ten columns, ten rows - Each with a word in it. I want to change the values of some/all of the cells in the table via a hyperlink. How do I reference each cell and...
4
by: Sujan | last post by:
Hello all, Is it possible to change the text of Address bar when i click on any link. Does any one knows the script to do this. Sujan.
1
by: amber | last post by:
Hi there, I'd like to change the colour of my tabs. I can change my background colour of my tab control, but the actual tabs, with the text on them don't change colour. Am I missing something?...
4
by: Patrick Noll | last post by:
hi ng, i have a problem when i try to change the text property of a TreeNode just before the user is able to edit this property. Example: // Label before anything happens... TreeNode.Text =...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the text in the url/location bar?...
2
by: go2bee | last post by:
How to do import/copy text from webpage <textarea> and <text> to text in form MS-Access97 Thankyou.
0
by: go2bee | last post by:
How to do import/copy text from webpage <textarea> and <text> paste to text in the form MS-Access97 Thankyou!
5
by: ramadeviirrigireddy | last post by:
Hi All, I'm new to this group. I'm working on Java/J2ee. In my project i have one bricklet with header it will have some default color.But when mouseovers on this header i need to change the...
6
by: K Viltersten | last post by:
I have the following button: <asp:LinkButton id="Btn" runat="server" text="Click"> </asp:LinkButton> I have added an action listener in the javascript where I change the text on it:...
14
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I tried a google search but could not find anything. I am trying to cause one webpage to reload when a second web page is closed. The second webpage loads data into a session variable and when...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.