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
>
查看全文
相关阅读:
Java 抽象类 初学者笔记
JAVA super关键字 初学者笔记
Java 标准输入流 初学者笔记
JAVA 将对象引用作为参数修改实例对象参数 初学者笔记
JAVA 根据类构建数组(用类处理数组信息) 初学者笔记
JAVA 打印日历 初学者笔记
Python 测试代码 初学者笔记
Python 文件&异常 初学者笔记
Python 类 初学者笔记
ubuntu网络连接失败
原文地址:https://www.cnblogs.com/simhare/p/926160.html
最新文章
关于thymeleaf中th:if的使用
使用Eclipse开发Web项目(JSP)——简单登录、无sql
新手学Html之JSP基础语法——入门(二)
新手学Html之JSP简介——入门(一)
12.Project Fields to Return from Query-官方文档摘录
11.Query an Array of Embedded Documents-官方文档摘录
10.Query an Array-官方文档摘录
9.Query on Embedded/Nested Documents-官方文档摘录
8.Query Documents-官方文档摘录
7.Insert Methods-官方文档摘录
热门文章
6.Insert Documents-官方文档摘录
5.MongoDB CRUD Operations-官方文档摘录
4.Data Types in the mongo Shell-官方文档摘录
3.Write Scripts for the mongo Shell-官方文档摘录
数据库视图
计算机网络
oracle中SQL的功能
ooracle数据类型
oracle数据库的结构
oracle数据库的介绍
Copyright © 2011-2022 走看看