好久没有上来了!分享下拉带复选框简单代码,并散分……
<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 " name= "aaa " class=openleft id= "aaa "> </td>
</tr>
<tr>
<td align= "left ">
<input type= "checkbox " name= "b1ALL " onclick= "checkAll(this, 'b1 ') "> 全选 </td>
</tr>
<tr>
<td align= "left ">
<input type= "checkbox " name= "b1 " value= "bbb " onclick= "checkItem(this, 'b1ALL ') "> bbb </td>
</tr>
<tr>
<td align= "left ">
<input type= "checkbox " name= "b1 " value= "ccc " onclick= "checkItem(this, 'b1ALL ') "> ccc </td>
</tr>
<tr>
<td align= "left ">
<input type= "checkbox " name= "b1 " value= "ddd " onclick= "checkItem(this, 'b1ALL ') "> ddd </td>
</tr>
</form>
</table>
</TD> </TR>
</TABLE>
</BODY>
</HTML>
[解决办法]
试试先
[解决办法]
问一个sql问题,有2列
a b
1 2
1 3
2 4
3 4
如何得到
1
2
3
4
[解决办法]
接分~~~~~~
[解决办法]
领分了!
[解决办法]
mark.
[解决办法]
JF
[解决办法]
嗯嗯。接分。
[解决办法]
JF
[解决办法]
mark
[解决办法]
看看,顺便接分
[解决办法]
JF
[解决办法]
document.form1.b1ALL.checked;这一行报错:为空或者不是对象。有时间选几次就没有菜单了。
[解决办法]
学习
[解决办法]
俺也好长时间没来了
接分,收藏
[解决办法]
学习
[解决办法]
接分接分
------解决方案--------------------
接---------------------------------------------分
[解决办法]
蹭分`~
[解决办法]
接分,.,学习...
[解决办法]
学习 and 接分
[解决办法]
又见散分贴,超喜欢啊~~~
[解决办法]
暂时无用
[解决办法]
以后在看!
jf!
[解决办法]
收藏一下再说
[解决办法]
学习
[解决办法]
支持一下
[解决办法]
感谢楼主的分享