首页 > CMS > 动易CMS > 正文

解决登录时,按回车后跳到了搜索页面的问题

2024-09-10 21:56:14
字体:
来源:转载
供稿:网友

问题:登录时,按回车后跳到了搜索页面

解决方法:在后台管理 >> 系统设置 >> 模板标签管理 >> 标签管理 >> 标签模板设置 找到您调用的登陆标签,如“ 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>

 

然后保存。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选