Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Click checkbox 2 highlight row don’t work
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Click checkbox 2 highlight row don’t work

 Post Reply Post Reply
Author
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Topic: Click checkbox 2 highlight row don’t work
    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.


Edited by ngaisteve1
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.