ASP.NET绑定CHECKBOXLIST--------JQUERY绑定CLICK事件,获取CHECKBOX的VALUE和显示值
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script src="Scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(function () {
$("input[type='checkbox']").click(function () {
var lvalue = $(this).val();//获取value值
// alert(lvalue);
var lname = $(this).next().text();//获取text值
var yuanGong = document.getElementById("TextArea1");
yuanGong.value = yuanGong.value + lname;
}
);
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<textarea id="TextArea1" cols="60" rows="6"></textarea>
<br />
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem Value="sddsds">2</asp:ListItem>
<asp:ListItem>1221</asp:ListItem>
<asp:ListItem>4343</asp:ListItem>
<asp:ListItem>4343</asp:ListItem>
<asp:ListItem>gg</asp:ListItem>
<asp:ListItem>gfgfgf</asp:ListItem>
</asp:CheckBoxList>
</div>
</form>
</body>
</html>
最新文章
- EntityFramework、Dapper vs 草根框架性能大比拼,数据库访问哪家强?
- 理解autorelease
- 腾讯QQ认证空间4月27日已全面开放申请,欲进军自媒体
- Linux定时任务Crontab详解
- CentOS下 MySQL5.7 详细的部署安装流程
- JDK7学习笔记之基础类型
- 大家是怎么做Code Review的?
- 阿牛的EOF牛肉串[HDU2047]
- Xshell选中的同时把内容复制到剪贴板(还可以设置设置文本分隔符)
- 20145218 《Java程序设计》第五周学习总结
- 使用tortoisegit管理git 和 权限验证
- Asp.net--Ajax前后台数据交互
- winform 获取文件夹的名称 分类: WinForm 2014-08-04 15:50 242人阅读 评论(0) 收藏
- retain two decimal digits.
- 14.1.3 检查InnoDB 可用性:
- 使用Spring的@Autowired 实现DAO, Service, Controller三层的注入(转)
- cocos2d-x C++的do...while(0)另类使用方法
- JavaScript的预编译和执行
- 在 IDEA中运行 WordCount
- 封装jdbc、DBUtil
热门文章
- 【穷竭】POJ3187-Backward Digit Sums
- 【模拟+递归+位运算】POJ1753-Flip Game
- kong结合consul
- 浙南联合训练赛 H - The number of positions
- 【MySQL笔记】解除输入的安全模式,Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconnect.
- WPF Interaction框架简介(一)——Behavior
- Oracle10g 创建一个DataBase实例
- zk常见面试题
- Android ANR优化 1
- Storm应用系列之——集成Kafka