如何点击按钮时,将文本框的值传到内嵌叶的表单中去? 直接到demo10.asp中通过parent.document.getElementById("aTextId").value就可以取到值了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 以下代码做适当修改基本符合你的需求。参考:http://community.csdn.net/Expert/topic/5101/5101499.xml?temp=.9007837test.html-------------------------------------------------------------------------------------<input type=button value=调用本页函数 onclick=record(myframe.myform,v)><input type=button value=调用框架函数 onclick=myframe.record(myframe.myform,v)><br/>选其一即可<br/><input name='mytest' value="mytext"><iframe name=myframe src="test.asp"></iframe><script>function record(obj,v){obj.mytest.all.value=document.all.mytest.value;alert("传值成功")obj.submit();}</script>test.asp----------------------------------------------------------------------------<form id=myform action="" target=_self method=post> <%page=request("page")response.write request("sub")if request("mycheck")<>"" thenstrCheckedValues=request("mycheck")response.write strCheckedValues 'PassIt '调用删除 page=cstr(cint(page)+1) '这里转化主要是为了符合你的函数调用end if url="Default.asp" 'Call DB_Connection(DSNstring) sql="select ID,name,adrress,PhoneNum,birthday from tbl_Member WHERE IsPass='0'" 'Call cutPage(sql,Connector,"12",page,url)'20代表每页显示20条记录 %><!--你的数据//--><input name="mytest"><input type=checkbox name=mycheck value=1>内容<br/><input type=checkbox name=mycheck value=2>内容<br/><input type=checkbox name=mycheck value=3>内容<br/><input type=checkbox name=mycheck value=4>内容<br/><input type=checkbox name=mycheck value=5>内容<br/></form><script>function record(obj,v){obj.all.mytest.value=v;obj.submit();}</script> 好长,我要的是点击按钮把文本框的值传过去,并提交表单,代码帮忙看看那里有错?<script>function get_data(string){FrameT.form1.hidden.value=string;FrameT.form1.submit();}</script><input name="key" type="text" class="tables" size="14"> <input name="Submit" type="button" class="tables" value="Search" onClick="get_data(key)">----框架叶----<iframe src="aa.asp" width="745" height="488" scrolling="yes" frameborder="0" name="FrameT"> onClick="get_data(document.all.key.value)"> ******页面1*************<script>function get_data(string){document.all.key1.value=string;if(document.getElementById('FrameT').height==450){document.getElementById('FrameT').height=450+1;} else{document.getElementById('FrameT').height=450;}}</script><input name="key" type="text" class="tables" size="14" value="芙蓉姐姐"><input name="key1" type="hidden" value=""><input name="Submit" type="button" class="tables" value="Search" onClick="get_data(document.all.key.value)"><iframe src="asdf1.asp" width="745" height="450" scrolling="yes" frameborder="0" id="FrameT">**********页面2 请取名asdf1.asp 做测试**************<script language=javascript> window.onresize=s;function s(){if(parent.document.all.key1.value!==""){ document.all.a.action="http://www.baidu.com/s?wd="+parent.document.all.key1.value; alert(document.all.a.action); document.all.a.submit(); }} </script> <form name="a" action=""><input name="key2" type=submit></form>***************************************成功了,原理:1。点搜索2。将输入内容放入一个隐藏的input中3。让frame的高度+1或减14。页面2将引发window.onresize事件5。页面2读取页面1中的input隐藏内容6。如果不是空值就提交。不知道是不是符合要求?我开始用focus事件,结果只要切换到IE,它就马上触发,要提交好多次。所以换成了改frame的大小。旁门左道吧 FrameT.form1.hidden.value=string;这里应该用input的名字而不是input的类型,把hidden换成key。 js问题,实在没有办法了。 象这种选中的效果用js怎么写 求助:web页面中如何调用系统桌面目录(treeview 包括c:d:e:系统的目录盘)?(file component) 怎么让一个图片和TD的高度相同,想破头皮都不知道,请大家帮帮我 问题一宗 JavaScript用户注销如何返回请求页面并刷新 急!动态表格中某一行的颜色问题,请给代码,我是用html作的 escape和unescape具体用法? 哪位大神帮我看看这个js是什么意思呢? 为啥外部js不能获取html内的td标签? div屏蔽页面,实现透明效果,怎么做 javascript传参数问题
参考:http://community.csdn.net/Expert/topic/5101/5101499.xml?temp=.9007837
test.html
-------------------------------------------------------------------------------------<input type=button value=调用本页函数 onclick=record(myframe.myform,v)>
<input type=button value=调用框架函数 onclick=myframe.record(myframe.myform,v)>
<br/>选其一即可
<br/>
<input name='mytest' value="mytext">
<iframe name=myframe src="test.asp"></iframe>
<script>
function record(obj,v){
obj.mytest.all.value=document.all.mytest.value;
alert("传值成功")
obj.submit();
}
</script>
test.asp
----------------------------------------------------------------------------
<form id=myform action="" target=_self method=post>
<%
page=request("page")
response.write request("sub")
if request("mycheck")<>"" then
strCheckedValues=request("mycheck")
response.write strCheckedValues
'PassIt '调用删除
page=cstr(cint(page)+1) '这里转化主要是为了符合你的函数调用
end if
url="Default.asp"
'Call DB_Connection(DSNstring)
sql="select ID,name,adrress,PhoneNum,birthday from tbl_Member WHERE IsPass='0'"
'Call cutPage(sql,Connector,"12",page,url)'20代表每页显示20条记录
%>
<!--你的数据//-->
<input name="mytest">
<input type=checkbox name=mycheck value=1>内容<br/>
<input type=checkbox name=mycheck value=2>内容<br/>
<input type=checkbox name=mycheck value=3>内容<br/>
<input type=checkbox name=mycheck value=4>内容<br/>
<input type=checkbox name=mycheck value=5>内容<br/>
</form>
<script>
function record(obj,v){
obj.all.mytest.value=v;
obj.submit();
}
</script>
我要的是点击按钮把文本框的值传过去,并提交表单,代码帮忙看看那里有错?
<script>
function get_data(string)
{
FrameT.form1.hidden.value=string;
FrameT.form1.submit();
}
</script>
<input name="key" type="text" class="tables" size="14">
<input name="Submit" type="button" class="tables" value="Search" onClick="get_data(key)">----框架叶----
<iframe src="aa.asp" width="745" height="488" scrolling="yes" frameborder="0" name="FrameT">
function get_data(string){
document.all.key1.value=string;
if(document.getElementById('FrameT').height==450){document.getElementById('FrameT').height=450+1;}
else{document.getElementById('FrameT').height=450;}
}
</script>
<input name="key" type="text" class="tables" size="14" value="芙蓉姐姐">
<input name="key1" type="hidden" value="">
<input name="Submit" type="button" class="tables" value="Search" onClick="get_data(document.all.key.value)">
<iframe src="asdf1.asp" width="745" height="450" scrolling="yes" frameborder="0" id="FrameT">**********页面2 请取名asdf1.asp 做测试**************
<script language=javascript>
window.onresize=s;
function s(){
if(parent.document.all.key1.value!==""){
document.all.a.action="http://www.baidu.com/s?wd="+parent.document.all.key1.value;
alert(document.all.a.action);
document.all.a.submit();
}
}
</script>
<form name="a" action="">
<input name="key2" type=submit>
</form>***************************************
成功了,原理:
1。点搜索
2。将输入内容放入一个隐藏的input中
3。让frame的高度+1或减1
4。页面2将引发window.onresize事件
5。页面2读取页面1中的input隐藏内容
6。如果不是空值就提交。
不知道是不是符合要求?我开始用focus事件,结果只要切换到IE,它就马上触发,要提交好多次。
所以换成了改frame的大小。旁门左道吧
这里应该用input的名字而不是input的类型,把hidden换成key。