模仿asp.net的checkboxList控件
<script type="text/javascript">
function rowIn(obj){
obj.style.backgroundColor="#316AC5";
obj.style.color="#FFFFFF";
}
function rowOut(obj){
obj.style.backgroundColor="#FFFFFF";
obj.style.color="#000000";
}
function rowCheck(obj){
obj.firstChild.firstChild.checked=!obj.firstChild.firstChild.checked;
}
</script>
<select multiple>
<option>1</option>
<option>2</option>
</select>
<div style="width:200px;height:200px;border:1px solid #7F9DB9">
<div style="margin:1px;width:195px;height:195px;overflow:auto;border-top:1px solid #716F64;border-left:1px solid #716F64;border-right:1px solid #F1EFE2;border-bottom:1px solid #F1EFE2">
<table style="width:100%">
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="1">计划A</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="2">计划B</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="3">计划C</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="4">计划D</td>
</tr>
</table>
</div>
</div>
希望能帮助从事java Web开发兄弟姐妹们!
function rowIn(obj){
obj.style.backgroundColor="#316AC5";
obj.style.color="#FFFFFF";
}
function rowOut(obj){
obj.style.backgroundColor="#FFFFFF";
obj.style.color="#000000";
}
function rowCheck(obj){
obj.firstChild.firstChild.checked=!obj.firstChild.firstChild.checked;
}
</script>
<select multiple>
<option>1</option>
<option>2</option>
</select>
<div style="width:200px;height:200px;border:1px solid #7F9DB9">
<div style="margin:1px;width:195px;height:195px;overflow:auto;border-top:1px solid #716F64;border-left:1px solid #716F64;border-right:1px solid #F1EFE2;border-bottom:1px solid #F1EFE2">
<table style="width:100%">
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="1">计划A</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="2">计划B</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="3">计划C</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="4">计划D</td>
</tr>
</table>
</div>
</div>
希望能帮助从事java Web开发兄弟姐妹们!
...全文
相关推荐
asp.net Dropdownlist结合CheckBoxList多选下拉框
asp.net Dropdownlist结合CheckBoxList多选下拉框
ASP.NET中CheckBoxList复选框列表控件详细使用方法
本文主要介绍CheckBoxList几种常见的用法,并做出范例演示供大家参考,希望对学习asp.net的朋友有所帮助。
Asp.net CheckBoxList操作集合
CheckBoxList操作方法集合,包括:获取选中项、全选、取消、反选
asp.net Javascript获取CheckBoxList的value
以后我会陆续的写出这段时间中学习到的东西,与大家一起分享。这篇文章也算是工作中的一个笔记吧,希望给遇到同样问题的朋友,一点小小的帮助。 在 开发工作中,因为要做用到CheckBoxList在客户端用js操作,无论js怎样调试,就是无法获取value的值,很是郁闷,后来Google了下,去了趟CodeProject,算是幸运的。我们在网页上放置一下代码: 代码如下: <asp runat=”server” ID=”chkDemo” RepeatDirection=”Horizontal” RepeatLayout=”Flow”> <asp:ListItem Text=
ASP.NET中用js取CheckBoxList中值的方法实例
用脚本取CheckBoxList中的值,并用"|"将其分开,之后将取到的值放入文本框,返回数据库做添加或者修改


