<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//ZH-CN"
" http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html ">
<title></title>
<script type="text/javascript">
onload=function()
{
setChange(document.body)
}
function setChange(obj)
{
var CHArray=obj.getElementsByTagName("input");
for(var i=0;i<CHArray.length;i++)
{
CHArray[i].onclick=function()
{
al(this);
}
}
}
function al(obj)
{
var result=document.getElementById("result");
if(obj.checked)
{
if(result.value.length==0)
{
result.value=obj.value;
}else
{
result.value+=","+obj.value;
}
}else
{
if(result.value.search(obj.value)!=-1)
{
if((result.value.search(obj.value)==0)&&(result.value!=obj.value))
{
result.value=result.value.replace(obj.value+",",'');
return;
}
if(result.value.search(","+obj.value)!=-1)
{
result.value=result.value.replace(","+obj.value,'');
}
else
{
result.value=result.value.replace(obj.value,'');
}
}
}
}
</script>
</head>
<body style="font-size:12px;">
<input type="checkbox" value="刘德华" id="a" /> <label for="a">刘德华</label>
<input type="checkbox" value="个体工商户管理费、" id="b" /> <label for="b">个体工商户管理费、</label>
<input type="checkbox" value="主业公告栏" id="d" /> <label for="d">主业公告栏</label>
<input type="checkbox" value="企业年检公告 " id="e" /> <label for="e">企业年检公告 </label>
<input type="checkbox" value="市场管理费" id="c" /> <label for="c">市场管理费</label>
<textarea style="200px;height:400px;" id="result"></textarea>
</body>
</html>