新手请教如何实现单选按钮选中之后转到不同的网页 <input type=radio name=aa onclick="document.location.href="指定网页.htm""> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 网才里面的引号打错了:<input type=radio name=aa onclick="document.location.href='指定网页1.htm'"><input type=radio name=aa onclick="document.location.href='指定网页2.htm'"> 我不是在点的时候就跳转而是submit的时候跳转写一个javascript判断那个单选被选中不知道怎么写先谢谢了 <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>测试页</title></head><body><form name=form1><input type=radio value="http://www.163.com" name=t1>163 <input type=radio value="http://www.sina.com.cn" name=t1>sina<input value="确定" type=button onclick="return check()"></form><script language="javascript"><!--function check(){ n="";var t1=form1.t1.length;if(!t1) { if(form1.t1.checked==true) {n=form1.t1.value;} } else { for (var k=0;k<t1;k++) { if(form1.t1[k].checked==true) {n=form1.t1[k].value; break;} } } if(n=="") {alert("请先选择");} else { if(confirm("你选择了:"+n+"\n确认要跳到选择页吗?")) location.href=n; } }//--></script></body></html> 一道难题,希望大家可以解决,类似dreamweaver效果 javascript理解难题。。。。谁能解释一下 JS代码在Firefox中失效,没有调用如何解决?? 如何判断字符串中是否存在#,谢谢大家! 如何获取table中的值? 有无json or dom or js oop 的学习的和例子? 请教下关于面向对象单一原则和相关的接口功能问题 如何动态改变元素的name 如何让file控件的那个text框不显示? 如何对一个“file”赋值呢? 怎样在javascript中把textarea.area中的换行替换为<br>标记 在线等 马上结帐:哪里有好点的flash教程啊? 3Q 了 !!
网才里面的引号打错了:<input type=radio name=aa onclick="document.location.href='指定网页1.htm'">
<input type=radio name=aa onclick="document.location.href='指定网页2.htm'">
而是submit的时候跳转
写一个javascript判断那个单选被选中不知道怎么写
先谢谢了
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>测试页</title>
</head><body>
<form name=form1>
<input type=radio value="http://www.163.com" name=t1>163
<input type=radio value="http://www.sina.com.cn" name=t1>sina
<input value="确定" type=button onclick="return check()">
</form>
<script language="javascript">
<!--
function check()
{
n="";
var t1=form1.t1.length;
if(!t1)
{
if(form1.t1.checked==true)
{n=form1.t1.value;}
}
else
{
for (var k=0;k<t1;k++)
{
if(form1.t1[k].checked==true)
{n=form1.t1[k].value;
break;}
}
}
if(n=="")
{alert("请先选择");}
else
{
if(confirm("你选择了:"+n+"\n确认要跳到选择页吗?"))
location.href=n;
}
}
//-->
</script></body></html>