复选框问题,将选定的值在textarea显示

复选框问题.
http://www.corange.cn//uploadfiles/5910a31cd99b7c8c86d6b603_11073.jpg

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<script language="javascript">
function showUser(UserName, UserTrueName)
{
cbx = this.document.getElementById(UserName);

UserName+=",";
UserTrueName+=",";

if (cbx.checked == true) {
document.form1.UserName.value+=UserName;
document.form1.UserTrueName.value+=UserTrueName;
}else{
var UN;
var UTN;
UN=document.form1.UserName.value;
UTN=document.form1.UserTrueName.value;
document.form1.UserName.value=UN.replace(UserName,"");
document.form1.UserTrueName.value=UTN.replace(UserTrueName,"");
}
}
</script>
</head>
<body topmargin="0" leftmargin="0">
<table border="1" width="340" cellspacing="0" cellpadding="0" bordercolor="#E9E8E3" bordercolordark="#FFFFFF" bgcolor="#F7F9F9">
<form id="form1" name="form1" method="post" action="">

<tr bgcolor="#F5FFE7">
<td>
<input name="nanhu" type="checkbox" id="nanhu" value="checkbox" οnclick=showUser("nanhu","王建斌") />王建斌
</td>
<td> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td><input name="admin" type="checkbox" id="admin" value="checkbox" οnclick=showUser("admin","管理员") />
管理员</td>
<td> </td>
</tr>
<tr bgcolor="#F5FFE7">
<td><input name="soufox" type="checkbox" id="soufox" value="checkbox" οnclick=showUser("soufox","望见宾") />
望见宾</td>
<td> </td>
</tr>
<tr bgcolor="#F5FFE7">
<td><input name="comasp" type="checkbox" id="comasp" value="checkbox" οnclick=showUser("comasp","comasp") />
comasp</td>
<td> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td><input name="lishan" type="checkbox" id="lishan" value="checkbox" οnclick=showUser("lishan","李三") />
李三</td>
<td> </td>
</tr>
<tr>
<td align="center">
<textarea name="UserTrueName" id="UserTrueName" readonly rows="2" cols="30"></textarea>
</td>
<td align="center">
<textarea name="UserName" id="UserName" readonly rows="2" cols="30"></textarea>
</td>
</tr></form>
</table>

</BODY>
</HTML>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值