View Full Version : check box

07-16-2005, 01:55 PM
hi all

Example: mail.yahoo.com
when we go to inbox page of mail.yahoo.com, if we have messages in our inbox, they come in the form of checkboxes one after another.
if we wanna delete one message, we select the checkbox of that message and press the delete button.
if we wanna delete all messages then we select the top checkbox and all the check boxes get selected.
i wanna know this how to select all check boxes on the selection of one check box.

07-16-2005, 02:31 PM

is java script an option?
is there a link?
does that link answer yr question?

07-16-2005, 02:31 PM
Hi there amir,

try this little script, it may give you some ideas...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<title>check all</title>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<meta name="Content-Style-Type" content="text/css">

<script type="text/javascript">

var chk=document.getElementsByTagName('input');

function checkAll() {
if(document.forms[0][0].checked==true) {
for(i=0;i<chk.length;i++) {
if(chk[i].type=='checkbox') {
else {
for(i=0;i<chk.length;i++) {
if(chk[i].type=='checkbox') {


<form action="#">

<li><input type="checkbox" onclick="checkAll()"><label>check all</label></li>
<li><input type="checkbox"></li>
<li><input type="checkbox"></li>
<li><input type="checkbox"></li>
<li><input type="checkbox"></li>
<li><input type="checkbox"></li>


reason for edit - original script did not allow for the unchecking of the check all box


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum