好久没有上来了!分享下拉带复选框简单代码,并散分……
<HTML> <HEAD> <TITLE> </TITLE>
<script language=Javascript>
var values= " ";
document.form1.b1ALL.checked;
function checkAll(e, itemName)
{
var bb;
var aa = document.getElementsByName(itemName);
for (var i=0; i <aa.length; i++)
{
aa[i].checked = e.checked;
}
if (!e.checked)
{
document.form1.aaa.value= " ";
}
else
{
document.form1.aaa.value= "All ";
}
}
function checkItem(e, allName)
{
var all = document.getElementsByName(allName)[0];
if(!e.checked)
{all.checked = false;
showItem( "b1 ");
}
else
{
showItem( "b1 ");
var aa = document.getElementsByName(e.name);
for (var i=0; i <aa.length; i++)
if(!aa[i].checked) return;
all.checked = true;
document.form1.aaa.value= "All ";
}
}
function showItem(itemName)
{
var aa = document.getElementsByName(itemName);
for (var i=0;i <aa.length ;i++)
{
if (aa[i].checked)
{
if (values== " ")
{
values = aa[i].value;
}
else
{
values = values + ", " + aa[i].value;
}
}
}
document.form1.aaa.value=values;
values= " ";
}
</script>
<META http-equiv=Content-Type content= "text/html; charset=gb2312 ">
<LINK href= "css.css " type=text/css rel=stylesheet>
<BODY bgColor=#dedfde leftMargin=0 marginwidth= "0 " topmargin= "0 ">
<TABLE width= "80% " align= "center " cellPadding=0 cellSpacing=0 id= "thelast ">
<TR height= "67 ">
<TD valign= "top " width= "9% ">
<table width= "100% " class=close
onMouseOut= "this.style.visibility= 'hidden ' ";
onMouseOver= "this.style.visibility= 'visible ' " cellpadding= "0 " cellspacing= "0 ">
<form name= "form1 " method= "post " action= " ">
<tr>
<td height=23 align= "left "> <input type= "text " n