<input type=radio name=a1 checked>111111111
<input type=radio name=a1>111111111
<input type=radio name=a1>111111111
<input type=radio name=a1>111111111

解决方案 »

  1.   

    谢谢 lbd8848(lbd)的回复,可能我没有表达清楚:
    我想要的效果为:
    <input type=radio name=a1>111111111
    <input type=radio name=a2>111111111
    <input type=radio name=a3>111111111
    <input type=radio name=a4>111111111在这几项中任意选择一项,比方说a3 ,页面刷新后,a3 仍显示被选中的状态
    如果选a4 ,页面刷新后,a4仍显示被选中的状态
      

  2.   

    这样吗 ...<%
      dim arrv,i
      arrv = split(request.form("h1"),",")
    %><script language="javascript">
    <!--
      function fncsubmit()
      {
        var h = '';
        var o = document.getElementsByTagName('INPUT');
        for(var i=0;i<o.length;i++)
        {
          if(o[i].type == 'radio')
          {
            h += o[i].checked + ',';
          }
        }
        h = h.substr(0,h.length-1);
        document.all.h1.value = h;
        form1.submit();
      }
    //-->
    </script><form name=form1 method=post action=a.asp>
    <input type=radio name=a1 <% if arrv(0)="true" then response.write "checked" %>>111111111
    <input type=radio name=a2 <% if arrv(1)="true" then response.write "checked" %>>111111111
    <input type=radio name=a3 <% if arrv(2)="true" then response.write "checked" %>>111111111
    <input type=radio name=a4 <% if arrv(3)="true" then response.write "checked" %>>111111111
    <p><input type=button value=submit onclick="fncsubmit();"></p>
    <input type=hidden name=h1>
      

  3.   

    sorry,上面有点错误~~~<%
      dim arrv,i
      if request.form("h1") <> "" then
        arrv = split(request.form("h1"),",")
      end if
    %><script language="javascript">
    <!--
      function fncsubmit()
      {
        var h = '';
        var o = document.getElementsByTagName('INPUT');
        for(var i=0;i<o.length;i++)
        {
          if(o[i].type == 'radio')
          {
            h += o[i].checked + ',';
          }
        }
        h = h.substr(0,h.length-1);
        document.all.h1.value = h;
        form1.submit();
      }
    //-->
    </script><form name=form1 method=post action=a.asp>
    <input type=radio name=a1 
    <% if request.form("h1") <> "" then
         if arrv(0)="true" then response.write "checked" 
       end if %>
    >111111111
    <input type=radio name=a2 
    <% if request.form("h1") <> "" then
         if arrv(1)="true" then response.write "checked" 
       end if %>
    >111111111
    <input type=radio name=a3 
    <% if request.form("h1") <> "" then
         if arrv(2)="true" then response.write "checked" 
       end if %>
    >111111111
    <input type=radio name=a4 
    <% if request.form("h1") <> "" then
         if arrv(3)="true" then response.write "checked" 
       end if %>
    >111111111
    <p><input type=button value=submit onclick="fncsubmit();"></p>
    <input type=hidden name=h1>
      

  4.   


    <body>
    <form name=s1 method=post action=a.asp>
    <input type=radio name=a1 value=1 onclick="s1.submit()">111111111
    <input type=radio name=a1 value=2 onclick="s1.submit()">222222222
    <input type=radio name=a1 value=3 onclick="s1.submit()">333333333
    <input type=radio name=a1 value=4 onclick="s1.submit()">444444444
    </form>
    <script>
    var c="<%=request.form("a1")%>";
    if (c=="1") {document.s1.a1[0].checked=true;}
    if (c=="2") {document.s1.a1[1].checked=true;}
    if (c=="3") {document.s1.a1[2].checked=true;}
    if (c=="4") {document.s1.a1[3].checked=true;}
    </script>
      

  5.   

    谢谢zltostem(尘寞),要的就是这个东东不过能有用于html 的javascript吗?
      

  6.   

    感谢大侠们的关注,可是asp 我是一点都不懂,能有用于html 的javascript吗lbd8848(lbd) 的方法很好,很简练
      

  7.   

    javascript,无法将在中途运行中的产生的变量值在刷新后直接保留下来,如果要使用javascript做可以考虑使用COOKIES
      

  8.   

    不是没有想过,但是用COOKIES的话就需要客户端支持,如果客户端禁止了,就一样达不到效果
      

  9.   

    那就使用fso建立一个临时文件存储你的变量,不过速度,复杂程度都比以上的差,且与cookies有可能被禁用,
    建议还是使用asp或其他语言的相关方法进行较方便
      

  10.   

    还是用cookie最合适了,其他都不太好