runxinzhi.com
首页
百度搜索
js 取得CheckBoxList的选中项的值
父页面:(TextBox1用来接收子页面(user_code.aspx)传回来的值)
<
script
language
="javascript"
type
="text/javascript"
>
function
show_win()
{
var
var_win
=
0
;
showModalDialog('user_code.aspx',[window,document.getElementById(
"
TextBox1
"
).id],'status:Modeless;edge:raised;unadorned:no;scroll
=
no;resizable:yes;center:yes;help:no;dialog520px;dialogheight:420px');
}
</
script
>
子页面(user_code.aspx):
<
script
language
="javascript"
type
="text/javascript"
>
function
selected_info(str)
{
var
CheckBoxList
=
document.all.CheckBoxList1;
var
textbox
=
document.all.hid_user_code;
textbox.value
=
""
;
var
objCheckBox ;
for
(i
=
0
;i
<
CheckBoxList.rows.length;i
++
)
{
objCheckBox
=
document.getElementById(
"
CheckBoxList1_
"
+
i);
if
(objCheckBox.checked
==
true
)
{
textbox.value
+=
CheckBoxList.rows[i].cells[
0
].childNodes(
1
).innerText
+
"
,
"
;
}
}
window.dialogArguments[
0
].document.getElementById(window.dialogArguments[
1
]).value
=
textbox.value;
window.close();
}
</
script
>
<
form
>
<
div
>
<
table
style
=" 403px; height: 282px"
>
<
tr
>
<
td
style
=" 100px"
>
<
asp:Label
ID
="Label1"
runat
="server"
Text
="用户编号:"
Width
="72px"
></
asp:Label
>
</
td
>
</
tr
>
<
tr
>
<
td
style
=" 100px"
>
<
asp:CheckBoxList
ID
="CheckBoxList1"
runat
="server"
>
</
asp:CheckBoxList
>
</
td
>
</
tr
>
</
table
>
<
hr
/>
<
asp:Button
ID
="btn_confirm"
runat
="server"
Text
="确定"
/>
</
div
>
<
input
id
="hid_user_code"
runat
="server"
type
="text"
/>
</
form
>
相关阅读:
linux-tar备份
实验
华为HCIA-命令及配置
1、基本知识
linux 安装samba
POJ 2676 Sudoku (搜索,Dancing Links)
HDU 1535 Invitation Cards (最短路,附SLF优化SPFA)
ZOJ 3625 Geek's Collection (数学公式,注意long double输出格式,附输出格式总结)
SGU 185 Two shortest (最大流)
SPOJ PROFIT Maximum Profit (最大闭合权子图,最小割)
原文地址:https://www.cnblogs.com/simhare/p/926160.html
最新文章
docker-compose入门示例
Xshell生成秘钥免密登录
docker常用命令总结
Kubernetes实践之深入掌握Pod——Pod的升级和回滚
Kubernetes实践之深入掌握Pod——玩转Pod调度
Alertmanager部署和简单使用
URL和URI的区别
class命名规范
微信小程序的button按钮设置宽度无效
JS实现九宫格抽奖(一)-匀速版
热门文章
cnpm 指令无响应
VS Code编辑器显示“无法验证,因为未设置任何 PHP 可执行文件。请使用设置
chrome浏览器控制台元素截图
git克隆项目安装依赖报错
Git建立+解除关联相关操作
linux 添加本地yum源
linux 安装redis
mysql的配置文件参数
linux 安装mysql5.7
linux-安装oracle 11g
Copyright © 2020-2023
润新知