补充:即要求选择的RADIO值不同,当点选某个RADIO后,立即改变RADIO的值显示,或者能把RADIO值赋给某一变量,供我在ASP中使用也可.

解决方案 »

  1.   

    疯了?lz没搞清楚客户端代码跟服务器端代码的关系~~<script>
    var arr={"1":"步行","2":"汽车","3":"自行车"};
    function Init(){
        var rd=document.all.radio;
        for(var i=0;i<rd.length;i++){
            rd[i].onclick=function(){
                document.getElementById("result").innerHTML="你选择的是:"+arr[this.value];
                document.getElementById("aspRadioValue").value=arr[this.value];
            }
        }
    }
    window.onload=Init;
    </script>
    <form>
    <input type="radio" value="1" checked name="radio">方式一 
    <input type="radio" value="2" name="radio">方式二 
    <input type="radio" value="3" name="radio">方式三 
    <div id="result">你选择的是:步行</div>
    <input type="submit" /><!-- 隐藏值,这个提交后才能获取值 -->
    <input type="hidden" id="aspRadioValue" />
    </form>
      

  2.   

    <body> 
    <table border="1" width="100%" id="table1" height="217"> 
    <tr> 
    <td> 
    <script>
    function gotoUrl(v)
    {
      window.location='?t='+v;
    }
    </script>
    请选择方式: <input type="radio" value="1" name="radio" onclick="gotoUrl(this.value)"> 方式一 <input type="radio" value="2" name="radio" onclick="gotoUrl(this.value)"> 方式二 <input type="radio" value="3" name="radio" onclick="gotoUrl(this.value)"> 方式三 </td> 
    </tr> 
    <% 
    dim t:t=request.querystring("t")
    dim radio
    if t="1" then
     radio="步行" 
    elseif t="2" then
     radio="汽车" 
    elseif t="3" then
     radio="自行车" 
    end if
    %> 
    <tr> <td> 你选择的方式是: <%=radio%> </td> </tr> 
    </table>