var str1
str1=i.value
if(radio.checked=true){
   text2.value=str1 & "A"
}else{
   text2.value=str1 & "B"
}

解决方案 »

  1.   

    不知是不是这个意思----------------------------------
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 1</title>
    <script>
    function show()
    {
      var obj1=document.all("R1");
      var obj2=document.all("R2");
      if(obj1.checked==true)
      {
        document.all("T2").value=document.all("i").name+"+'A'";
      }
      else(obj1.checked==true)
      {
        document.all("T2").value=document.all("i").name+"+'B'";
      }
    }
    </script>
    </script>
    </head><body onload="show();"><form method="POST" action="" name="Form1">
      <p><input type="text" name="i" size="20" value="aaaa"></p>
    </form>
    <form method="POST" action="" name="Form2">
      <p><input type="radio" value="A" name="R1"><input type="radio" value="B" checked name="R2"></p>
    </form>
    <form method="POST" action="" name="Form3">
      <p><input type="text" name="T2" size="20"></p>
    </form></body></html>
      

  2.   

    是判断radio的value么?<SCRIPT LANGUAGE="JavaScript">
    <!--
    function clk()
    {
    if( form1.r1.value != 0 )
    form1.t1.value = form1.i.value + "A"
    else
    form1.t1.value = form1.i.value + "B"
    }
    //-->
    </SCRIPT><form name=form1>
      <br><input name=i>i
      <br><input type=radio name=r1 value=1 onClick="clk()">r1
      <br><input name=t1>
    </form>
      

  3.   

    <html><head>
    <script>
    function add()
    {
       var a=document.getElementsByName("rr")
       var str=""
       for(i=0;i<a.length;i++)
       {
         if(a[i].checked){str=a[i].value}
       }
       f1.t2.value=f1.t1.value+str
    }
    </script>
    </head><body><form name="f1" method="POST" action="">
     <p>
      <input type="text" name="t1" size="20"><input type="radio" value="A" checked name="rr">A<input type="radio" name="rr" value="B">B</p>
      <p><input type="text" name="t2" size="20"></p>
      <p><input type="button" value="按钮" name="B1" onclick="add()"></p>
    </form></body></html>
      

  4.   

    参见如下程序:
    _______________________________________________________________
    <script>
    function doit(){
    bbvalue=document.aa.source1.value;
    if(document.aa.source2[0].checked)
    bbvalue+=document.aa.source2[0].value;
    else 
    bbvalue+=document.aa.source2[1].value;
    document.bb.showit.value=bbvalue;
    return false;
    }
    </script>
    <form name=aa onclick="return doit()">
    <input type=text name=source1>
    <input type=radio value='radio1' name=source2>
    <input type=radio value='rado2' name=source2>
    <input type=submit value=ok>
    </form>
    <form name=bb>
    <textarea name=showit></textarea>
    </form>
    __________________________________________________________