怎样改变表单中的单选框的name属性?
张志龙 2003-10-06 04:44:02 我的这个为什么不行?
document.form1.elements[6].name="stype";
错在哪里?
以下是部分代码,谢谢指点。
<script>
function go(){
if(document.form1.music[0].checked){
document.form1.elements[0].name="keyword";
document.form1.elements[6].name="stype";
document.form1.stype[0].value="Music";
document.form1.action="http://www.sina.com";
}
}
</script>
</head>
<body>
<form name="form1" method="post" onsubmit="return go(this)" target="_blank">
<p>
<input type="text" size="25" name="textfield">
<input type="radio" name="music" value="" checked>
1
<input type="radio" name="music" value="" >
2
<input type="radio" name="music" value="" >
3
<input type="radio" name="music" value="">
4
<input type="submit" name="Submit" value="搜索" >
</p>
<p>
<input id=all type=radio name=ul value="">
xxx yyy zzz ttt </p>
</form>