all_checked.js

来自「《jsp案例开发》这本书的源代码。包括源代码和相关的具体配置操作步骤。非常不错」· JavaScript 代码 · 共 124 行

JS
124
字号
function setAllChecked( resultlist )
{
	if( resultlist != null )
	{
		for( var i = 0; i < resultlist.length; i++ )
		{
			if( resultlist[ i ].checked )
			{
				resultlist[ i ].checked = false
			}
			else
			{
				resultlist[ i ].checked = true
			}
		}
	}
	if( resultlist.value != 0 )
	{
		if( resultlist.checked )
		{
			resultlist.checked = false
		}
		else
		{
			resultlist.checked = true
		}
	}
}
function checkdelete( resultlist )
{
	var tag = false;
	if( resultlist.value != 0 )
	{
           if( resultlist.checked )
	        tag = true;
	}
	if (resultlist != null) 
	{
		for( var i = 0; i < resultlist.length; i++ )
			if( resultlist[ i ].checked )
				tag = true;
	}
	if (tag == false)
		{
			alert("请先选择要删除的记录!");
			return false;			
		}
	else
			return confirm('确认删除记录吗?');
}

function checkallpass( resultlist )
{
	var tag = false;
	if( resultlist.value != 0 )
	{
           if( resultlist.checked )
	        tag = true;
	}
	if (resultlist != null) 
	{
		for( var i = 0; i < resultlist.length; i++ )
			if( resultlist[ i ].checked )
				tag = true;
	}
	if (tag == false)
		{
			alert("请先选择要审批的记录!");
			return false;			
		}
	else
			return confirm('确认审批通过?请稍后填写审批意见');
}

function checkallunpass( resultlist )
{
	var tag = false;
	if( resultlist.value != 0 )
	{
           if( resultlist.checked )
	        tag = true;
	}
	if (resultlist != null) 
	{
		for( var i = 0; i < resultlist.length; i++ )
			if( resultlist[ i ].checked )
				tag = true;
	}
	if (tag == false)
		{
			alert("请先选择要审批的记录!");
			return false;			
		}
	else
			return confirm('确认修改为审批未通过?');
}

function checkallexp( resultlist )
{
	var tag = false;
	if( resultlist.value != 0 )
	{
           if( resultlist.checked )
	        tag = true;
	}
	if (resultlist != null) 
	{
		for( var i = 0; i < resultlist.length; i++ )
			if( resultlist[ i ].checked )
				tag = true;
	}
	if (tag == false)
		{
			alert("请先选择要导出的项目计划!");
			return false;			
		}
	else
			return confirm('确认要导出此项目计划?');
}




		

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?