check all




JavaScript Source Code 3000: Buttons: Check All



































Check All






Dynamically checks and unchecks all the checkboxes in a form when a button is clicked. Much easier than manually hard-coding the checkbox names, for sure. Updated to only require one button to check and uncheck all boxes.








Your Favorite Scripts & Languages
Java
JavaScript
ASP
HTML
SQL










JavaScript Source Code 3000: Buttons: Check All
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!





    





<!-- TWO STEPS TO INSTALL CHECK ALL:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Modified By: Steve Robison, Jr. (stevejr@ce.net) -->

<! >
<! >

<!-- Begin
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return "Uncheck All"; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return "Check All"; }
}
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<center>
<form name=myform action="" method=post>
<table>
<tr><td>
<b>Your Favorite Scripts & Languages</b><br>
<input type=checkbox name=list value="1">Java<br>
<input type=checkbox name=list value="2">JavaScript<br>
<input type=checkbox name=list value="3">ASP<br>
<input type=checkbox name=list value="4">HTML<br>
<input type=checkbox name=list value="5">SQL<br>
<br>
<input type=button value="Check All" onClick="this.value=check(this.form.list)">
</td></tr>
</table>
</form>
</center>



<!-- Script Size: 1.47 KB -->





















Wyszukiwarka

Podobne podstrony:
All T
ALL L130310?lass101
Eamon All over Love
Abc All Of My Heart
Mac Dre All?mn?y
Kiss Uh All Night
mb bus all
Dido All You Want
ALL L32510?lass101
Plauger, P J @ Nebula Award 1975 @ Child of All Ages
Sutter Sharing is root of all contention
All Flesh Must Be Eaten Thirteen Ways to Die, Choose One
AJA All Japan Award
All the Sad Young Men
01 52 Check control module 01
Klamca 4 Killem All Fabryka Slow Fantastyka

więcej podobnych podstron