解决登录时,按回车后跳到了搜索页面的问题_动易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教程