zoukankan
html css js c++ java
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
>
查看全文
相关阅读:
服务器
python的并发编程学习
python的网络编程学习
python的基础学习 模块
pymysql基础操作
查询简单练习
数据准备
数据库的三大设计范式
数据库基础-建表约束
mysql基础-基本语法
原文地址:https://www.cnblogs.com/simhare/p/926160.html
最新文章
this 的值到底是什么???
javascript 闭包
h5 离线缓存机制-manifest
jQuery 选择器效率
redis主从同步
mysql索引小记
jvm垃圾收集小记
对象序列化
Java容器之HashMap源码分析
java中函数是值传递还是引用传递?
热门文章
构建高效可申缩的结果缓存
成小胖学习微服务架构·基础篇
念奴娇
shell 快速入门
python常用的一些文件操作
周总(05.18)
前端css
周总(05.10)
python爬虫
周总(05.03)
Copyright © 2011-2022 走看看