View Single Post
Old 01-20-2013, 08:55 PM   PM User | #1
Rcoleman25
New Coder

 
Join Date: Jun 2012
Posts: 20
Thanks: 9
Thanked 0 Times in 0 Posts
Rcoleman25 is an unknown quantity at this point
Select Checkbox on Page Load

Hello,

I need to automatically check a checkbox on page load. The thing is that the checkbox I want to check is a checkall box which checks others within the same form. Here is the code...


<script type="text/javascript">
/* This script and many more are available free online at
The JavaScript Source!! http://www.javascriptsource.com
Created by: Hillel Aftel | */
function checkAll(checkname, exby) {
for (i = 0; i < checkname.length; i++)
checkname[i].checked = exby.checked? true:false
}
</script>

<form name ="vspecs">
<input type="checkbox" name="specall" onClick="checkAll(document.vspecs.equip,this)"> Select All
<input type="checkbox" name="equip" value="aride"> Air-Ride
Rcoleman25 is offline   Reply With Quote