• <bdo id='8hVWe'></bdo><ul id='8hVWe'></ul>

    <small id='8hVWe'></small><noframes id='8hVWe'>

  • <tfoot id='8hVWe'></tfoot>
    <legend id='8hVWe'><style id='8hVWe'><dir id='8hVWe'><q id='8hVWe'></q></dir></style></legend>
      1. <i id='8hVWe'><tr id='8hVWe'><dt id='8hVWe'><q id='8hVWe'><span id='8hVWe'><b id='8hVWe'><form id='8hVWe'><ins id='8hVWe'></ins><ul id='8hVWe'></ul><sub id='8hVWe'></sub></form><legend id='8hVWe'></legend><bdo id='8hVWe'><pre id='8hVWe'><center id='8hVWe'></center></pre></bdo></b><th id='8hVWe'></th></span></q></dt></tr></i><div id='8hVWe'><tfoot id='8hVWe'></tfoot><dl id='8hVWe'><fieldset id='8hVWe'></fieldset></dl></div>

        即使在回发后也保持用户检查radiobtn检查

        keep user checked radiobtn checked even after postback(即使在回发后也保持用户检查radiobtn检查)
        <tfoot id='8ygMM'></tfoot>
      2. <i id='8ygMM'><tr id='8ygMM'><dt id='8ygMM'><q id='8ygMM'><span id='8ygMM'><b id='8ygMM'><form id='8ygMM'><ins id='8ygMM'></ins><ul id='8ygMM'></ul><sub id='8ygMM'></sub></form><legend id='8ygMM'></legend><bdo id='8ygMM'><pre id='8ygMM'><center id='8ygMM'></center></pre></bdo></b><th id='8ygMM'></th></span></q></dt></tr></i><div id='8ygMM'><tfoot id='8ygMM'></tfoot><dl id='8ygMM'><fieldset id='8ygMM'></fieldset></dl></div>

        <small id='8ygMM'></small><noframes id='8ygMM'>

                <tbody id='8ygMM'></tbody>
              <legend id='8ygMM'><style id='8ygMM'><dir id='8ygMM'><q id='8ygMM'></q></dir></style></legend>

                  <bdo id='8ygMM'></bdo><ul id='8ygMM'></ul>
                  本文介绍了即使在回发后也保持用户检查radiobtn检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有以下无线电控制,默认选中为全部".如果用户检查其他单选按钮并提交,则在回发时我想保留选中的按钮,以便用户可以看到他们点击的内容..如何保留使用 jquery 选择的内容?我使用的是:

                  I have the following radiocontrols with Default checked to "All". If user checks some other radio button and submits, on postback i want to retain the checked button, so users can see what they clicked..How do I keep whatever was selected using jquery?? i am using is:

                  <script type="text/javascript" language="javascript">
                   $(document).ready(function() { 
                      var url = 'http://mysite.com/events/Pages/default1.aspx?kwd=';
                      $(".SearchBoxAndChoices a.searchButton").click(function() {
                      var radioVal = $("input[name='EventType']:checked").val();
                      var keywords = encodeURIComponent($(".BasicSearchInputBox").val());  
                      url =url+keywords+"&type="+radioVal;
                      window.location.href=url;  
                      });
                   });
                  </script>                     
                  
                   <div class="EventRadios" style="color:#574319; font:13px Trebuchet">
                      <input type="radio" name="EventType" value="" checked="checked"/>All &nbsp;  
                      <input type="radio" name="EventType" value="Classes" />Class &nbsp;  
                      <input type="radio" name="EventType" value="Events" />Event &nbsp;    
                      <input type="radio" name="EventType" value="Support Groups" />Support Group&nbsp;&nbsp;<br /><br />
                  </div>
                  <input name="KeywordBox" class="BasicSearchInputBox" type="text" value="Keyword Search..."/>
                  <div class="searchBtnHolder"><a class="searchButton" href="#" type="submit"><span>Search</span></a></div>
                  

                  推荐答案

                  这里有一个快速的方法:

                  Here's a quick way:

                  var value = window.location.href.match(/[?&]type=([^&#]+)/) || [];
                  
                  if (value.length == 2) {
                      $('input[name="EventType"][value="' + value[1] + '"]').prop('checked', true);
                  }
                  

                  这是一个演示:http://jsfiddle.net/agW9g/

                  这篇关于即使在回发后也保持用户检查radiobtn检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  keeping radio buttons checked after form submit(表单提交后保持选中单选按钮)
                  Styling radio button - not work in IE and Firefox(样式单选按钮 - 在 IE 和 Firefox 中不起作用)
                  Toggle HTML radio button by clicking its label(通过单击标签来切换 HTML 单选按钮)
                  Javascript how to change radio button label text?(Javascript如何更改单选按钮标签文本?)
                  JavaScript radio button confirmation(JavaScript 单选按钮确认)
                  How can I automatically select specific radio buttons with Greasemonkey?(如何使用 Greasemonkey 自动选择特定的单选按钮?)
                  <i id='GyuuS'><tr id='GyuuS'><dt id='GyuuS'><q id='GyuuS'><span id='GyuuS'><b id='GyuuS'><form id='GyuuS'><ins id='GyuuS'></ins><ul id='GyuuS'></ul><sub id='GyuuS'></sub></form><legend id='GyuuS'></legend><bdo id='GyuuS'><pre id='GyuuS'><center id='GyuuS'></center></pre></bdo></b><th id='GyuuS'></th></span></q></dt></tr></i><div id='GyuuS'><tfoot id='GyuuS'></tfoot><dl id='GyuuS'><fieldset id='GyuuS'></fieldset></dl></div>
                        <tbody id='GyuuS'></tbody>
                        <bdo id='GyuuS'></bdo><ul id='GyuuS'></ul>

                        <small id='GyuuS'></small><noframes id='GyuuS'>

                        <tfoot id='GyuuS'></tfoot>
                        <legend id='GyuuS'><style id='GyuuS'><dir id='GyuuS'><q id='GyuuS'></q></dir></style></legend>