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
>
查看全文
相关阅读:
Windows--查看端口占用
设计模式--策略模式--简记
Java--运算符的优先级表
乐观锁和悲观锁--简记
设计模式--适配器模式--简记
设计模式--建造者模式--简记
设计模式--抽象工厂模式--简记
设计模式--工厂方法模式--简记
寒假学习进度
程序员修炼之道--从小工到专家阅读笔记03
原文地址:https://www.cnblogs.com/simhare/p/926160.html
最新文章
分页与页表
空闲内存管理
缓冲区溢出攻击
多线程互斥问题
为什么IO多路复用需要采用非阻塞式IO
客户端父进程提前死亡
服务器过早终止问题
关于shutdown和close
io多路复用-select()
winscp的root连接ubuntu“拒绝访问”的解决方法
热门文章
Ubuntu下安装Docker
Kotlin 的 Array 转 List
Android ListView滚动条配置完全解析
在Linux服务器上运行jar包,并且使jar包一直处于后台执行
Ubuntu下设置开机后自动运行命令
Gradle构建SpringBoot并打包可运行的jar配置
在IDEA中如何将Spring boot项目打包成可执行的jar包并发布到linux服务
springboot打包成jar文件无法正常运行,解决办法已经找到
Kotlin学习笔记(9)- 数据类
Spring--简记
Copyright © 2011-2022 走看看