-----------------------------------------------------------------

<form method="post" name="form1">
    <label><input type="radio" name="radio" value="1-10 岁">1-10 岁</label>
    <label><input type="radio" name="radio" value="11 岁">11 岁</label>
    <label><input type="radio" name="radio" value="12-120 岁">12-120 岁</label>
    <input type="button" onclick="ok()" value="测试选择值">
  </form>

 

 

 

-----------------------------------------------------------------


<form method="post" name="form2">
    <input type="text" name="textfield">
  </form>

 

-----------------------------------------------------------------

 


<script language="javascript" type="text/javascript">
<!--
function ok()
{
  var temp=document.getElementsByName("radio");
  for (i=0;i<temp.length;i++){
  //遍历Radio
    if(temp[i].checked)
      {alert("你选择了"+temp[i].value);
      //获取Radio的值
      document.form2.textfield.value="你选择了"+temp[i].value;
      //传递给另外一个表单
      }
  }
}
-->
</script>

相关文章:

  • 2021-11-10
  • 2021-07-31
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
  • 2021-11-19
猜你喜欢
  • 2022-12-23
  • 2021-10-09
  • 2022-01-16
  • 2021-11-18
  • 2022-12-23
  • 2021-11-15
相关资源
相似解决方案