probe 2 차 개발 (3)

950 단어 JavaScripthtmljsp
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;
				}
			}
		}
	}

좋은 웹페이지 즐겨찾기