解決登錄時,按回車后跳到了搜索頁面的問題_動易Cms教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!

      問題:登錄時,按回車后跳到了搜索頁面

      解決方法:在后臺管理 >> 系統設置 >> 模板標簽管理 >> 標簽管理 >> 標簽模板設置 找到您調用的登陸標簽,如“ Ajax用戶登錄”,找到后修改,找到下面代碼

      <div id="LoginFrom" style="display:none" class="Login_ajax">
      <SCRIPT LANGUAGE="JavaScript">
      <!--

                          function refreshValidateCodeImage(ValidateCodeImageControl)
                          {
                              ValidateCodeImageControl.src =  ValidateCodeImageControl.src + '?code=' + randomNum(10);
                          }
                          function randomNum(n){
                              var rnd='';
                              for(var i=0;i<n;i++)
                                   rnd+=Math.floor(Math.random()*10);
                              return rnd;
                          }
                 
      //-->
      </SCRIPT>

       

      改成:

       <div id="LoginFrom" style="display:none" class="Login_ajax" onkeypress="javascript:return DefaultButton(event, 'BtnLogOn')">
      <SCRIPT LANGUAGE="JavaScript">
      <!--

                          function refreshValidateCodeImage(ValidateCodeImageControl)
                          {
                              ValidateCodeImageControl.src =  ValidateCodeImageControl.src + '?code=' + randomNum(10);
                          }
                          function randomNum(n){
                              var rnd='';
                              for(var i=0;i<n;i++)
                                   rnd+=Math.floor(Math.random()*10);
                              return rnd;
                          }
                        function DefaultButton(event, target)
                         {
                             if (event.keyCode == 13 && !(event.srcElement && (event.srcElement.tagName.toLowerCase() == "textarea")))
                           {
                             var defaultButton = document.getElementById(target);
                             if (defaultButton && typeof(defaultButton.click) != "undefined")
                              {
                             defaultButton.click();
                             event.cancelBubble = true;
                             if (event.stopPropagation) event.stopPropagation();
                             return false;
                               }
                           }
                           return true;
                         }


      //-->
      </SCRIPT>

       

      然后保存。

      查看更多 動易Cms教程  動易Cms模板

      來源:模板無憂//所屬分類:動易Cms教程/更新時間:2009-07-22
      相關動易Cms教程