<html>
<body>
<%
Randomize
rad=int(130*rnd+1)
%>
<form id="my1" name="my1" >
<input type="text" name="txts" id="txts" onClick="javascript:ShowDialog('namelist.asp?id=<%response.Write(rad)%>',this.id,this.form.id,10,100) ;"/>
<input type="text" name="txt2" id="txt2" onClick="javascript:ShowDialog('namelist.asp?id=<%response.Write(rad)%>',this.id,this.form.id,10,100) ;"/>
</form>
</body>
</html>
<script language="JavaScript">
function ShowDialog(url,whichText,whichForm,width, height, optValidate) {
var arr = showModalDialog(url,window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:on;status:off;resizable:on");
}
</script>
namelist.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--#include file=commom/connect_servers.asp-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>姓名列表</title>
</head><body><form id="form1" name="form1">
<%
strs="select companyid,companypersonname from companyTable"
rss.open strs,conns,1,3
if not rss.eof then
while not rss.eof
idss=Trim(rss("companyid"))
names=Trim(rss("companypersonname"))
%>
<table width="95%" border="1" cellspacing="1" cellpadding="1">
<tr>
<td width="16%">
<input type="checkbox" value="<%response.Write(names)%>" id="box_<%response.Write(idss)%>" onchange="javascript:sends(this.id)" /> <%response.Write(names)%> </td>
</tr>
</table>
<%
rss.movenext
wend
else
response.Write("没有姓名")
end if
%>
</form>
</body>
</html>
<script type="text/javascript">
function sends(a)
{
var a;
var whichT=window.dialogArguments.whichText;
var whichF=window.dialogArguments.whichForm;
alert (whichT);
alert (whichF);
var b=document.getElementById(a).value;
var c=eval("document.form1."+ a).checked;
d=eval("window.dialogArguments.document.my1."+whichText+".value");
if(c) {
alert (d);
}
}
</script>
页面红色的部分为主要代码。但是namelist里面获取不到值。是不是哪里错了啊?请教大虾们
<body>
<%
Randomize
rad=int(130*rnd+1)
%>
<form id="my1" name="my1" >
<input type="text" name="txts" id="txts" onClick="javascript:ShowDialog('namelist.asp?id=<%response.Write(rad)%>',this.id,this.form.id,10,100) ;"/>
<input type="text" name="txt2" id="txt2" onClick="javascript:ShowDialog('namelist.asp?id=<%response.Write(rad)%>',this.id,this.form.id,10,100) ;"/>
</form>
</body>
</html>
<script language="JavaScript">
function ShowDialog(url,whichText,whichForm,width, height, optValidate) {
var arr = showModalDialog(url,window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:on;status:off;resizable:on");
}
</script>
namelist.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--#include file=commom/connect_servers.asp-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>姓名列表</title>
</head><body><form id="form1" name="form1">
<%
strs="select companyid,companypersonname from companyTable"
rss.open strs,conns,1,3
if not rss.eof then
while not rss.eof
idss=Trim(rss("companyid"))
names=Trim(rss("companypersonname"))
%>
<table width="95%" border="1" cellspacing="1" cellpadding="1">
<tr>
<td width="16%">
<input type="checkbox" value="<%response.Write(names)%>" id="box_<%response.Write(idss)%>" onchange="javascript:sends(this.id)" /> <%response.Write(names)%> </td>
</tr>
</table>
<%
rss.movenext
wend
else
response.Write("没有姓名")
end if
%>
</form>
</body>
</html>
<script type="text/javascript">
function sends(a)
{
var a;
var whichT=window.dialogArguments.whichText;
var whichF=window.dialogArguments.whichForm;
alert (whichT);
alert (whichF);
var b=document.getElementById(a).value;
var c=eval("document.form1."+ a).checked;
d=eval("window.dialogArguments.document.my1."+whichText+".value");
if(c) {
alert (d);
}
}
</script>
页面红色的部分为主要代码。但是namelist里面获取不到值。是不是哪里错了啊?请教大虾们
解决方案 »
- Flex3中的ConvolutionFilter类,参数个数问题!!!
- java web 开发连接数据库问题
- javascript与UTF-8编码问题
- 层移动问题
- javascript查找下拉表中包含文本的标签
- 在一个页面里面许多个checkbox,有些classname一样,有些不一样,怎样获取classname为'cb'且已经被打钩的checkbox
- 输入序列号时 如何自动移动焦点
- 菜鸟请教个问题
- 一个奇怪的现象!大家帮忙看看!
- 我要写一外接的js脚本可是总是报错请各位帮助急急急!!!!!!
- object.filters.alpha.opacity不是对象的错误
- 求熟悉WebFXTree的大虾帮帮忙
var arr = showModalDialog(url,window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:on;status:off;resizable:on");
}
加这句
window.whichT=whichText;
window.whichF=whichForm;
取值的时候
var T=window.dialogArguments.whichT;
var F=window.dialogArguments.whichF;
用这两句就可以了。我搞了半天 郁闷。再请教
var thistext;
var thisform;
var T=window.dialogArguments.whichT;
var F=window.dialogArguments.whichF;
var b=document.getElementById(thistext).value;
var c=eval("document."+thisform+"."+ thistext).checked;
var d=eval("window.dialogArguments.document."+F+"."+T).value;
if(c) {
d =d + b + " ";
}
}这个地方d =d + b + " ";
咋没效果呢?请指教下
如果你 alert(c) 就可以看到是 true目前关键是 d =d + b + " ";
这句 不起作用了 郁闷
d的引用变了,不是原来的对象了,当然不行咯
d =d + b + " ";
这样是对的哈。
是缓存的原因。清除缓存就搞定了 。呵呵。谢谢各位了哈。