我正在尝试使用三星Galaxy Android手机随附的默认浏览器查看我的网站,但无法正常工作。我似乎无法在弹出式登录表单中输入文本。当我尝试输入用户名时,HTML输入将成为焦点,并且预测性搜索开始进行,但不会在输入字段中输入任何文本。但是,我可以将文本成功输入到页面上的其他表单输入中(这些表单不在弹出div中)。

我猜这与以下事实有关:我的表单位于用户单击登录按钮时出现的绝对位置的div中。

我的几个同事已经在Android手机上尝试了该页面,并且能够按需输入文本,因此我认为这是OS /浏览器特有的问题。我正在运行Android 2.3.3,并使用其随附的默认浏览器。

这是登录div和表单输入的CSS:

.loginPanel{z-index:2000;width:341px;border-bottom-left-radius:3px;border-bottom-right-   radius:3px;background:#3DB44A;position:absolute;clear:left;margin:0 0 0     0;top:57px;display:none;padding:5px 0 0 0;}

.loginPanel input[type=text]{width:280px;height:40px;margin:0 auto;display:block;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;font:bold 12px Arial;color:#353535;padding:0 10px;}


这是HTML

<div class="loginPanel" style="margin-left: -246px; display: block;">
<form id="user_form_login" class="global_form_box" enctype="application/x-www-form-urlencoded" action="/login" method="post">
<div class="close">
<a id="login-close" href="#">
<img alt="" src="themes/network90v2/landing_images/close.png">
</a>
</div>
<div class="clear">
<input id="email" type="text" placeholder="Email" name="email">
</div>
<div id="username-required" class="form-label-required">
<span class="form-block-required">email is required</span>
</div>
<div id="username-invalid" class="form-label-required">
<span class="form-block-required">email is not valid</span>
</div>
<div class="clear">
<input id="password" type="password" placeholder="Password" name="password">
</div>
<div id="password-required" class="form-label-required">
<span class="form-block-required">password is required</span>
</div>
<div class="clear forgotten">
<span>
<a href="/user/auth/forgot">Forgot Password?</a>
</span>
</div>
<div class="submit-top"></div>
<div class="remember submitMain">
<input id="login-submit" type="submit" value="Login">
<input id="remember" type="checkbox" name="remember" value="1" tabindex="4">


记住账号
    
    
    
    

我希望可以使用CSS来解决此问题。如果任何人有解决方案/有相同的问题,我将非常感谢您的帮助。

PS:我真的很希望将登录表单保留为弹出窗口,因此理想情况下,任何解决方案都可以使我做到这一点。

最佳答案

我在Android 2.2上的行为异常的移动网站也遇到了类似的问题。从内存来看,我不得不使用position: fixed而不是绝对值来解决它。虽然不确定这是否适用于您的设计。

关于android - 尽管输入获得了焦点,但无法在Android移动网站的HTML输入字段中输入文本,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20263114/

10-12 00:33
查看更多