js 表单选项跳转不同页面并将文本框的值传递出去 本帖最后由 candata 于 2010-12-29 12:23:39 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 A页面<html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script language="javascript"> function jikongconnect() { window.open("HTMLPage16.htm?" + document.bb.tes.value); } </script></head><body> <form name="bb" id="bb"> <table> <tr> <td width="139" align="left" onclick="jikongconnect()" valign="bottom"> <input type="hidden" name="tes" id="tes" value="1" /><font color="#999999">生产集控系统</font> </td> </tr> </table> </form></body></html> B页面<html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title></head><body> <script language="javascript"> window.onload = function () { var s = location.search; s = s.substr(1, s.length - 1); alert(s); } </script></body></html> 传值取值就是这样,希望对楼主有用。这个方法出自这里:http://topic.csdn.net/u/20100605/17/e4ffe6ee-abfc-42e1-b0ed-bd7050303dd3.html <form name="form1" action="" method="post"><input name="keyword" id="keyword" type="text"><input type="radio" value=" http://www.google.cn" name="gturl" checked="checked"/>去谷歌<input type="radio" value=" http://www.qq.com" name="gturl"/>去腾讯<input type="radio" value=" http://www.baidu.com" name="gturl"/>去百度<br /><input type="button" value="提交选择" onclick="gotourl()"/></form><script language="javascript" type="text/javascript">function gotourl(){ var rdolist = document.getElementsByName('gturl'); for(var i=0;i<rdolist.length;i++) { if(rdolist[i].checked) { window.location.href=rdolist[i].value+"?keyword="+form1.keyword.value; return; } } }</script>靠人不如靠己,已经解决 如何绕过这个“在线学习防挂机”限制??? 麻烦帮看下,我这个代码有什么问题呢 麻烦介绍一本JavaScript的经典教程,最好可用于查询,谢谢! 在线急问!如何取鼠标点击区域的层的绝对坐标位置!up有分! javascript的实现 一个网页中两个SELECT,怎麽让点SELECT1的某项,在SELECT2中显示动态从数据库或folder中读出内容 关于Cookie的问题 谁对javascipt的脚本有加密的好方法,大家研究一下, js块级作用域,问题 一个关于节点遍历的问题 exejs 想在tab打开一个tab页面 鼠标在网页边缘 网页内容自动翻页
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function jikongconnect() {
window.open("HTMLPage16.htm?" + document.bb.tes.value);
}
</script>
</head>
<body>
<form name="bb" id="bb">
<table>
<tr>
<td width="139" align="left" onclick="jikongconnect()" valign="bottom">
<input type="hidden" name="tes" id="tes" value="1" /><font color="#999999">生产集控系统</font>
</td>
</tr>
</table>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<script language="javascript">
window.onload = function () {
var s = location.search;
s = s.substr(1, s.length - 1);
alert(s);
}
</script>
</body>
</html>
这个方法出自这里:http://topic.csdn.net/u/20100605/17/e4ffe6ee-abfc-42e1-b0ed-bd7050303dd3.html
<input name="keyword" id="keyword" type="text">
<input type="radio" value=" http://www.google.cn" name="gturl" checked="checked"/>去谷歌
<input type="radio" value=" http://www.qq.com" name="gturl"/>去腾讯
<input type="radio" value=" http://www.baidu.com" name="gturl"/>去百度<br />
<input type="button" value="提交选择" onclick="gotourl()"/>
</form>
<script language="javascript" type="text/javascript">
function gotourl()
{
var rdolist = document.getElementsByName('gturl');
for(var i=0;i<rdolist.length;i++)
{
if(rdolist[i].checked)
{
window.location.href=rdolist[i].value+"?keyword="+form1.keyword.value; return;
}
}
}
</script>靠人不如靠己,已经解决