Thursday 15 March 2012

asp classic - How can I get the background color of one HTML/ASP row to change when a boolean is set true? -


I have a table on the page-load that loads the data when the user clicks on an ID, then Row is required to highlight. Right now, I have found that when the user clicks on the ID, the boolean is set correctly, and then there is some other stuff. I have set that when boolean is correct, that line will be highlighted. However, this is not happening Can you help me?

  & lt;% if RS Record count & gt; 0 then RS ("ROLL_ID") = IntRollID then boolDetailTable = real end if%> & Lt; TR & lt;% if boolDetailTable = true then% & gt; Bgcolor "# CCFF00" & lt;% End if% & gt; & Gt; & Lt; One goal = _top href = "" OnMouseOver = "window.status = 'Click to get information'; Back to true;" OnMouseOut = "window.status = ''; Back to true;" & Gt; & Lt; TD style = "width: 9%; cursor: hand; border-right: none; align: center; vertical-align: center;" Title = "click to get information" & gt; & Lt; Font color = "navy" & gt; & Lt;% = RS ("ROLL_ID")%> & Lt; / Font & gt; & Lt; / Th & gt; & Lt; / A & gt; & Lt; TD style = "width = 25%" style = "font-size: 12pt" align = "center" & gt; & Amp; Nbsp; & Lt;% = RS ("ROLL_FINISH_DESC")% & gt; & Lt; / TD> & Lt; TD style = "width = 20%" style = "font-size: 12pt" align = "center" & gt; & Amp; Nbsp; & Lt;% = RS ("ROLL_DIAMETER")%> & Lt; / TD> & Lt; TD style = "width = 20%" style = "font-size: 12pt" align = "center" & gt; & Amp; Nbsp; & Lt;% = RS ("ROLL_CROWN")% & gt; & Lt; / TD> & Lt; TD style = "width = 10%" style = "font-size: 12pt" align = "center" & gt; & Amp; Nbsp; & Lt;% = RS ("ROLL_LOCKOUT_YN")% & gt; & Lt; / TD> & Lt; / TR & gt; & Lt;% RS.MoveNext () Loop End if% & gt; For beginners, you will need to change one of your code into the code below - you need    

& lt; Th & gt; or & lt; / Td> As you begin with , you have a mismatch.

For this example, I changed & lt; / TH> to

You will also see that I onClick (this.parent); to by

  & lt; TD onclic = "set collar (this.parent);" Style = "width: 9%; cursor: hand; border-right: none; align: center; vertical-align: center;" Title = "click to get information" & gt; & Lt; Font color = "navy" & gt; & Lt;% = RS ("ROLL_ID")%> & Lt; / Font & gt; & Lt; / TD & gt; Parents send   

OnClick elements - in this situation, the row is the same ( & lt; tr & gt; ) function To SetColor (elem)

In this way your page has a JavaScript function:

  function SetColor (elem) {elem.style. BackgroundColor = "# ff0000"; }   

This row should be changed to red for you.

No comments:

Post a Comment