立结,这样写取得单选按钮的值怎么不行? form2.wocao 取到的是个集合对象…… 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var f=""var objs=document.getElementsByName("wocao").valuefor(var i=0;i<objs.length;i++){ if(objs[i].checked) { f=objs[i].value break; }}alert(f) 因为form2.wocao是数组,没有value这个属性.但是有length这个属性. 这样写行吗? <scrip>function cxc(){ var f="";var objs=document.getElementsByName("wocao").value;for(var i=0;i<objs.length;i++){ if(objs[i].checked) { f=objs[i].value; break; }}return f;} </script> <input name="Edits" type="button" class="button" id="Edits2" value="Edit" onClick="javascript:var c=cxc();window.open('add_assigments.php?type=edit&id='+c);">为什么提示缺少对象? 不是,改正确了,还是提示。<form name="form2" method="post" ><script> function cxc(){var f="";var objs=document.getElementsByName("wocao").value;for(var i=0;i<objs.length;i++){ if(objs[i].checked) { f=objs[i].value break; }}return f;} </script> <input name="Edits" type="button" class="button" id="Edits2" value="Edit" onClick="javascript:var c=cxc();window.open('add_assigments.php?type=edit&id='+c); ">//这里是用PHP循环输出 .... 略 <input name="wocao" type="radio" class="box" value="<?php echo $my["assigments_id"];?>" onclick="show(this.value);" >// 全部代码就在上面了 <script>function cxc(){var f="";var objs=document.getElementsByName("wocao");for(var i=0;i<objs.length;i++){ if(objs[i].checked) { f=objs[i].value break; }}return f;} </script> 帮忙解释一下这个正则匹配的结果 js怎么去掉某个标签里面的内容 求一段用于验证用户名和密码输入是否规范的JS代码 请教高手,在线等 jquery包装集使用 用if判断后产生的一个按钮,能用onclick事件执行javascript函数吗?谢谢 浮动插件powerfloat影响页面打开的诡异问题 Google的Node和Node.js是一个东西么? 阿信,请进来看一下:你的这个函数好像有点 bug 请教JS参数传递。 能不能用JAVASCRIPT写出一个类似于DELPHI中dialog的对话框 请问一个正则表达式,有关匹配与或非的。
var objs=document.getElementsByName("wocao").value
for(var i=0;i<objs.length;i++)
{
if(objs[i].checked)
{
f=objs[i].value
break;
}
}
alert(f)
<scrip>
function cxc()
{
var f="";
var objs=document.getElementsByName("wocao").value;
for(var i=0;i<objs.length;i++)
{
if(objs[i].checked)
{
f=objs[i].value;
break;
}
}
return f;
}
</script>
<input name="Edits" type="button" class="button" id="Edits2" value="Edit" onClick="javascript:var c=cxc();window.open('add_assigments.php?type=edit&id='+c);">为什么提示缺少对象?
<script>
function cxc()
{
var f="";
var objs=document.getElementsByName("wocao").value;
for(var i=0;i<objs.length;i++)
{
if(objs[i].checked)
{
f=objs[i].value
break;
}
}
return f;
}
</script>
<input name="Edits" type="button" class="button" id="Edits2" value="Edit" onClick="javascript:var c=cxc();window.open('add_assigments.php?type=edit&id='+c); ">
//这里是用PHP循环输出 .... 略 <input name="wocao" type="radio" class="box" value="<?php echo $my["assigments_id"];?>" onclick="show(this.value);" >
//
全部代码就在上面了
function cxc()
{
var f="";
var objs=document.getElementsByName("wocao");
for(var i=0;i<objs.length;i++)
{
if(objs[i].checked)
{
f=objs[i].value
break;
}
}
return f;
}
</script>