•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 401,520 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,371 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 476 | Replies: 1
![]() |
| |
•
•
Join Date: Oct 2007
Posts: 11
Reputation:
Rep Power: 1
Solved Threads: 0
Hi i want to need javascript using datagrid, for example i have a datagrid and in datagrid above two check boxes 1)checked and 2) unchecked .In datagrid also 5 checkboxes is there ,if i clicked checked all checkboxes will select and if i'll clicked unchecked all unselect checkboxes will select ple any one help me (for examlple yahoo mail if we'll select button all will select like this )
•
•
Join Date: Feb 2008
Location: bangalore
Posts: 19
Reputation:
Rep Power: 1
Solved Threads: 2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript">
function checkAll(theElement) {
var theForm = theElement.form, z = 0;
for(z=0; z<theForm.length;z++){
if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
theForm[z].checked = theElement.checked;
}
}
}
</script>
</HEAD>
<BODY>
<form><input type="checkbox" name="check1"/>
<br/>
<input type="checkbox" name="check2"/>
<br/>
<input type="checkbox" name="check3"/>
<br/>
<input type="checkbox" name="check4"/>
<br/>
<input type="checkbox" name="check5"/>
<br/>
<input type="checkbox" name="checkall" onclick="checkAll(this);"/>Check All
<input type="checkbox" name="checkall" onclick="checkAll(this);"/>Uncheck All</form>
</BODY>
</HTML>
I HOPE THIS MAY HELP YOU
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript">
function checkAll(theElement) {
var theForm = theElement.form, z = 0;
for(z=0; z<theForm.length;z++){
if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
theForm[z].checked = theElement.checked;
}
}
}
</script>
</HEAD>
<BODY>
<form><input type="checkbox" name="check1"/>
<br/>
<input type="checkbox" name="check2"/>
<br/>
<input type="checkbox" name="check3"/>
<br/>
<input type="checkbox" name="check4"/>
<br/>
<input type="checkbox" name="check5"/>
<br/>
<input type="checkbox" name="checkall" onclick="checkAll(this);"/>Check All
<input type="checkbox" name="checkall" onclick="checkAll(this);"/>Uncheck All</form>
</BODY>
</HTML>
I HOPE THIS MAY HELP YOU
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
cross-browser javascript menu with few lines of code firefox firefox background-position problem solved html javascript javascript smooth scrolling scroll smoothly window document position javascript tab menu with rounded corners generator prevent javascript menu from getting hidden under flash movies preventing the delay when src attribute of the images set via javascript update panel scroll problem
- javascript links freezing/lagging computer. (Web Browsers)
- problem in javascript coding in asp page (ASP)
- Problem with Javascript on Webpage (Java)
- Add textbox to editable div problem (JavaScript / DHTML / AJAX)
- Using Javascript code in ASP.NET (JavaScript / DHTML / AJAX)
- Help: Only last loaded javascript runs (JavaScript / DHTML / AJAX)
- IE6 & XPsp2 refresh problem (Web Browsers)
- Page Cannot Be Displayed & javascript:doNetDetect() Errors (Viruses, Spyware and other Nasties)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Cannont submit form which holds another form inside it (Works on FF, but not on IE)
- Next Thread: Selcet/Deselcet All checkbox in Datagrid using Javascript


Hybrid Mode