probe二次开发(三)

修改session.jsp

<display:column class="leftmost" title="<input type='checkbox' name='selectall' onclick='selectAll(this.checked)'/>">
	<input type="checkbox" name="${session.id}" value="${session.serializable}"/>
</display:column>

JS
	/**
	 * select all add by Administrator Feb 05,2010
	*/
	function selectAll(flag){
		var checks = document.getElementsByTagName("input");
		var len = checks.length;
		for(var i=0;i<len;i++){
			alert(checks[i].type);
			if(checks[i].type == "checkbox"){					
				if(flag == true && checks[i].value == "true"){
					checks[i].checked = true;
				}else{
					checks[i].checked = false;
				}
			}
		}
	}

你可能感兴趣的:(JavaScript,html,jsp)