Webkit - 无法选择字段

时间:2012-01-20 14:44:26

标签: php javascript html

我遇到表单问题 - 我似乎无法选择密码字段。获得它的唯一方法是使用tab键转到该字段。这仅影响webkit浏览器。

这是表单html

public function form()
{
    global $ACL_LANG;
    $htmlForm = '<form id="frmlogin"><fieldset><label><dl><dt>';
    switch (LOGIN_METHOD) {
        case 'both' :
            $htmlForm .= $ACL_LANG ['USERNAME'] . '/' . $ACL_LANG ['EMAIL'];
            break;
        case 'email' :
            $htmlForm .= $ACL_LANG ['EMAIL'];
            break;
        default :
            $htmlForm .= $ACL_LANG ['USERNAME'];
            break;
    }
    $htmlForm .= '</label></dt>' . '<dd><input type="text" name="u" id="u" class="large" /></dd><dt>' . '<label>' . $ACL_LANG ['PASSWORD'] . '</label></dt>' . '<dd><input type="password" name="p" id="p" class="large" /></dd>' . '<input type="hidden" name="uri" id="uri" value="' . $_SERVER['REQUEST_URI'] . '" /></dl></fieldset><button type="submit" style="float:right;">Log in</button></form>';
    return $htmlForm;
}

这是管理页面的javascript

$.getJSON(postFile, function(data) {

    if (data.status == true) {
        // status is authorized
        if (autoRedir) {
            $(authentication).hide();
            $(authenticating).hide().html('Authentication success.').fadeIn('fast', function() {
                window.location = data.url;
            });
        } else {
            $(waitId).fadeOut('slow',
                function() {
                    $(wrapperId).html(data.message).slideDown();
                }).html();
        }
    } else {
        // show form
        $(wrapperId).html(data.message).fadeIn('0', function() {
            // hide  message
            $(waitId).fadeOut('fast',
                function() {

                    //*/ submit handler
                    $("#frmlogin").submit(function() {
                        // loading
                        $(waitId).hide();
                        $(notificationerror).hide();
                        $(notification).hide();
                        $(authentication).fadeIn();
                        $(wrapperId).hide();

                        var _u = $(userId).val();   // form user
                        var _p = $(passId).val();   // form id
                        var _uri = $(uri).val();    // form id

                        //@ valid user ( modify as needed )
                        if (_u.length < 4) {
                            $(authentication).hide();
                            $(notificationerror).html(jsErrMsg).fadeIn('fast', function() {
                            });
                            $(wrapperId).show();
                        }
                        else {
                            //@ valid password ( modify as needed )
                            if (_p.length < 4) {
                                $(authentication).hide();
                                $(waitId).html(notificationerror).fadeIn('fast', function() {
                                    $(passId).focus();
                                });
                            }
                            else {
                                $.post(postFile, { u: _u, p: _p, uri: _uri }, function(data) {
                                        if (data.status == true) {
                                            if (autoRedir) {
                                                $(authentication).html('Setting session.').fadeIn();
                                                 setTimeout("",2000);
                                                $(authentication).html('Authentication success.').fadeIn('fast', function() {
                                                    window.location = data.url;
                                                });
                                            } else {
                                                $(waitId).fadeOut('slow',
                                                    function() {
                                                        $(wrapperId).slideUp('slow', function() {
                                                            $(this).html(data.message).slideDown();
                                                        });
                                                    }).html();
                                            }
                                        } else {
                                            $(wrapperId).show();
                                            $(notification).show();
                                            $(authentication).hide();
                                            $(notificationerror).html(data.message).fadeIn(function() {
                                            });
                                        }
                                    }
                                    , 'json');
                            }
                        }
                        return false;
                    });
                    //*/
                }).html();
        });

    }

});

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

听起来如果你可以选择到场上但是不能点击它就会有一些东西覆盖它...因此阻碍了它。

如果您在Google Chrome中打开该网站...右键单击您尝试访问输入框的位置但被阻止。选择“检查元素”,它应该突出显示鼠标右键单击的元素。

您也可以将鼠标悬停在检查器中的元素上,以在页面上突出显示它们。这可能会揭示阻止它的是什么。