<script language=javascript>
<!--
function xxt(){
var i;
for(i=0;i<form1.xx.length;i++){
if(form1.xx[i].checked){
alert(form1.xx[i].value);
return;
}
}
alert('没有选择');
}
//-->
</script>
<P>
<FORM name="form1" action="" method=post>
<INPUT type=radio value="香蕉" name="xx">
Banana
<INPUT type=radio CHECKED value="苹果" name="xx">
Apple
<INPUT type=radio value=橘子 name="xx">
Orange
<INPUT type=button value=提交查询内容 onClick="xxt()">
<INPUT type="reset" value="重置">
<input type="text" name="yy">
</FORM>

解决方案 »

  1.   

    <script language=javascript>
    <!--
    function xxt(){
    var i;
    for(i=0;i<form1.xx.length;i++){
    if(form1.xx[i].checked){
    form1.yy.value=form1.xx[i].value);
    return;
    }
    }
    alert('没有选择');
    }
    //-->
    </script>
    <P>
    <FORM name="form1" action="" method=post>
    <INPUT type=radio value="香蕉" name="xx">
    Banana
    <INPUT type=radio CHECKED value="苹果" name="xx">
    Apple
    <INPUT type=radio value=橘子 name="xx">
    Orange
    <INPUT type=button value=提交查询内容 onClick="xxt()">
    <INPUT type="reset" value="重置">
    <input type="hidden" name="yy">
    </FORM>
      

  2.   

    你的让选中的radio的值赋过去才行呀