默认情况下,光标在页面加载字段的密码下

时间:2018-08-28 06:44:06

标签: javascript

请帮助我解决此问题,我有一个页面,该页面具有某些形式的验证 当您加载页面时,光标会自动进入密码字段,这对我来说是一个hack,请帮助我。

https://mobulous.app/healthapp/doctorlogin

enter image description here

2 个答案:

答案 0 :(得分:0)

您在下面的JS文件中有一个代码,该代码将inputPassword ID集中在 $(document).ready(function(){...})

https://mobulous.app/healthapp/public/assets/js/custome.js

代码:

$(document).ready(function(){

    $("#inputPassword").focus();

    $("#pwchecknext").click(function(){
        if ($("#pwchecknext").is(":checked"))
        {
            $(".oppwasconf").clone()
            .attr("type", "text").insertAfter(".oppwasconf")
            .prev().remove();
        }
        else
        {
            $(".oppwasconf").clone()
            .attr("type","password").insertAfter(".oppwasconf")
            .prev().remove();
        }
    });
});

您需要删除此 $(“#inputPassword”)。focus(); ,以免重新加载密码时自动聚焦。

答案 1 :(得分:0)

您有一行强制输入密码以引起注意:在第136行

enter image description here