Print Page | Close Window

Click checkbox 2 highlight row don’t work

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5667
Printed Date: 30 March 2026 at 9:40pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Click checkbox 2 highlight row don’t work
Posted By: ngaisteve1
Subject: Click checkbox 2 highlight row don’t work
Date Posted: 11 September 2003 at 2:09am
<script language = "Javascript">
<!--
var IE = (document.all) ? true : false;
var DOM = (document.getElementById) ? true : false;
var NS4 = (document.layers) ? true : false;

function action(elm,colOn,colOff){

if (elm.checked) {
colorRow(elm.value,colOn,'white');
// use white as highlighted foreground color text
} else {
colorRow(elm.value,colOff,'black');
// use black as default foreground color for text
}
}

function colorRow(which,Bcolr,Fcolr){
var whichRow = (IE) ? document.all[which] : (DOM) ? document.getElementById(which) : false;

if (whichRow) {
if (IE){
for (var i=0;i<whichRow.children.length;i++){
whichRow.children.style.backgroundColor=Bcolr;
whichRow.children.style.color = Fcolr;
}
} else if (DOM){
for (var i=0;i<whichRow.cells.length;i++){
whichRow.cells.style.backgroundColor=Bcolr;
whichRow.cells.style.color = Fcolr;
}
}

}


}

//-->
</javascript>

<form action=email_delete.asp method=post onSubmit="return ValidateForm(this,'list')">
<tr>
<td colspan=2>
<table border=1 cellspacing=0 cellpadding=2>
<tr valign="middle" bgcolor="#666666" style="color:#FFFFFF">
<td nowrap>Header</td>
<td nowrap>Date</td>
<td><input type=submit value=' X '></td>
</tr>
<%
Do While Not rs.EOF
response.Write "<tr valign=top id=" & rs("email_id") & "><td nowrap><A onclick=" & Chr(34) & "NewWindow(this.href,'name','440','200','yes');return false" & Chr(34) & " class=" & Chr(34) & "content" & Chr(34) & " HREF='email_view_form.asp?passkeyword=" & rs("email_id") & "'>" & rs("email_header") & "</a></td>"
response.write "<td nowrap>" & rs("email_date") & "</td>"
response.write "<td><input type='checkbox' name=" & rs("email_id") & " value=" & rs("email_id") & " onclick='action(this,'red','white')'></td></td&g t;"
rs.MoveNext
Loop%>
</table>
</td>
</tr>
<tr><td colspan=2><a href=email_add_form.asp class=content>Send E-Mail</a></td></tr>
</form>

When I click the checkbox, that row, should be highlighted, but it doesn't and I wonder what is the problem. Thanks for any help.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net