简体   繁体   English

密码输入字段在 ios safari 中不起作用

[英]Password input field doesn't work in ios safari

If you take a look at this page on an iPhone with safari, you see that when you tap the password input field and then start to type, what you typed in doesn't show on the screen and the cursor stays the same.如果您在带有 Safari 的 iPhone 上查看此页面,您会发现当您点击密码输入字段然后开始输入时,您输入的内容不会显示在屏幕上,并且光标保持不变。

I'm very curious what this could be.我很好奇这可能是什么。 I believe there isn't a HTML error or syntax problem.. but maybe I'm wrong.我相信没有 HTML 错误或语法问题.. 但也许我错了。 The HTML is generated by PHP, if that's of any help. HTML 是由 PHP 生成的,如果有帮助的话。

Please let me know if this is fixable and where I need to look.请让我知道这是否可以修复以及我需要查看的位置。 Thanks!谢谢!

UPDATE:更新:

Fixed.固定的。 Link is not working anymore.链接不再有效。

Are you sure that your HTML is correct?你确定你的 HTML 是正确的吗?

Correct syntax for a password field:密码字段的正确语法:

<input type="password" name="password">

The syntax on your page:您页面上的语法:

<input class="password" type="text" name="password" placeholder="**********" />

There may be some customisations in the class for "password". “密码”类中可能有一些自定义。 Anyway, it's not the standard way of defining password field, so not all browsers will behave as you expected.无论如何,这不是定义密码字段的标准方式,因此并非所有浏览器都会按照您的预期运行。

It's because you're using z-index on top of an image that overlays the input field.这是因为您在覆盖输入字段的图像上使用 z-index。 I think that in this case it's better to make either the div that's holding the z-index either smaller or get rid of it all together.我认为在这种情况下,最好将持有z-index的 div 变小或将其全部删除。

我遇到了同样的问题,只是将 autocomplete="current-password" 属性添加到输入元素。

<input type="password" name="password" autocomplete="current-password"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM