Webkit - 无法选择字段
我在使用表单时遇到问题 - 我似乎无法选择密码字段。访问它的唯一方法是使用 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();
});
}
});
有什么想法吗?
I'm having trouble with a form - I just can't seem to select the password field. The only way to get to it, is to go to the field using the tab key. This is only affecting webkit browsers.
this is the form 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;
}
This is the javascript governing the page
$.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();
});
}
});
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来如果您可以使用 Tab 键切换到该字段但无法单击它,那么就会有东西覆盖它......因此会妨碍。
如果您在 Google Chrome 中打开该网站...右键单击您尝试访问输入框但被阻止的位置。选择“检查元素”,它应该突出显示鼠标右键单击的元素。
您还可以将鼠标悬停在检查器中的元素上以在页面上突出显示它们。这可能会揭示是什么阻碍了它。
Sounds like if you can tab to the field but cant click onto it there's something overlaying it... therefore getting in the way.
If you open the site in Google Chrome... right click where you're trying to access the input box but getting blocked. Select 'Inspect Element' and it should highlight which element your mouse right clicked on.
You can also hover your mouse over elements in the inspector to highlight them on the page. This might reveal what's blocking it.