Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 20th, 2005, 10:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default Checkbox checked all

<head>
<script language=javascript>
function docheckall()
{
......
}

</script>

</head>

How can do by click button in js,
select all checkbox checked ?


do while rs.eof=false

Response.Write("<td><input type=checkbox name=dept value='" & rs("dept") & "' ></td>")

Response.Write("<td align=left>")
Response.Write("<a target=_self title='Select Emp No' href='showrep.asp?dept=" & (rs("dept")) & "'>" & rs("dept") & "</a>")
Response.Write("</td>")

'Response.Write("<td>" & rs("dept") & "</td>")

rs.movenext

loop


<INPUT id=submit2 name=submit2 type=submit value="Select All" title="Select All" onClick="docheckall()">

when user click Select All button, all check box do checked
how ?

regards.

Mateen



 
Old January 2nd, 2007, 06:19 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hai,
follow this,

<head>
<script language=javascript>
function docheckall()
{
    for(i=0; i <= document.form1.rec.value ; i ++ ){
    document.getElementById("count"+i).checked=true
    }
}

</script>

</head>
<form name="form1">
<%
count=0
do while rs.eof=false
count=count+1
Response.Write("<td><input type=checkbox name=dept&count id=dept&count value='" & rs("dept") & "' ></td>")

Response.Write("<td align=left>")
Response.Write("<a target=_self title='Select Emp No' href='showrep.asp?dept=" & (rs("dept")) & "'>" & rs("dept") & "</a>")
Response.Write("</td>")

'Response.Write("<td>" & rs("dept") & "</td>")

rs.movenext

loop
%>
<input type="hidden" name="rec" value="<%=count%>">
<INPUT id=submit2 name=submit2 type=submit value="Select All" title="Select All" onClick="docheckall()">
</form>

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
checkbox checked by default by html:checkbox sachin.tathod Struts 3 December 4th, 2006 03:41 PM
get the checked value from a checkbox array teklline123 Javascript How-To 1 September 16th, 2006 11:02 AM
Checkbox checked? ninel ASP.NET 2.0 Professional 1 April 12th, 2006 10:50 PM
Has checkbox been checked or unchecked? mat41 Javascript 4 December 8th, 2004 12:38 AM
allow only one checkbox to be checked! morpheus HTML Code Clinic 5 April 15th, 2004 10:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.