File: CheckAll.js

package info (click to toggle)
phpldapadmin 1.2.0.5-2%2Bsqueeze1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,248 kB
  • ctags: 3,066
  • sloc: php: 16,758; xml: 1,494; sh: 322; makefile: 50
file content (22 lines) | stat: -rw-r--r-- 545 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function CheckAll(setbgcolor,form,index) {
	htmlform = document.getElementById(form+index);

	for (var i=0;i<htmlform.elements.length;i++) {
		var e = htmlform.elements[i];

		if (e.type == 'checkbox' && e.name != 'allbox') {
			e.checked = htmlform.allbox.checked;

			if (!document.layers && setbgcolor) {
				var tr = document.getElementById('tr_'+e.id);

				if (e.checked) {
					tr.style.backgroundColor='#DDDDFF';
				} else {
					var id = e.id.substr(3);
					tr.style.backgroundColor= id%2 ? '#E0E0E0' : '#F0F0F0';
				}
			}
		}
	}
}