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
>
查看全文
相关阅读:
day14_集合框架1(ArrayList,LinkedList,HashSet)
day13_String、StringBuffer、StringBuilder
初识Java_day01
关于局部内部类访问带有final修饰符的局部变量
day03,day04_数组,循环(上)
day09(下)_异常(上)
day08_多态
day11_多线程(多线程安全问题)
day16_集合框架3(HashMap,TreeMap)
day09(上)_内部类
原文地址:https://www.cnblogs.com/simhare/p/926160.html
最新文章
防止SQL注入
接口属性
WPF布局该如何选用panel
<转载>JavaScript中的Function
流转化为字符串
一句代码让Activity变透明
年和周
二维码生成器源码
Drawable与Bitmap的相互转换
实现控件替换
热门文章
奇怪的Activity生命周期
关于getContentView
应用内截屏
拼XML的工具类
day10_异常(下)
day15_集合框架2(TreeSet,泛型)
day17_集合框架4(Collctions,Arrays,JDK1.5新特性)
day11_多线程(线程生命周期,Runnable)
day05_面向对象和this引用变量
day06_静态(static)
Copyright © 2011-2022 走看看