如何让Chrome尊重我的字段的名称,而不是试图自动完成 [英] How to make Chrome respect the names of my fields and not attempt to autocomplete
本文介绍了如何让Chrome尊重我的字段的名称,而不是试图自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有我的主页两种不同的形式:一个用于登录,一个用于注册。正如你可以从code看到的,形式有不同的名称输入:
I have two different forms on my home page: one for logins and one for registrations. As you can see from the code, the forms have inputs with different names:
<h3> Log In </h3>
<form action="/login/" method="POST" class="form-vertical" style="padding-top: 5px">
<input id="id_login_username" type="text" name="login_username" maxlength="25" />
<input type="password" name="login_password" id="id_login_password" /><br>
<button type="submit" class="btn btn-info">Login</button>
</form>
<h3> Sign Up <small>(It's free!)</small></h3>
<form action="/register/" method="POST" class="form-vertical" style="padding-top: 5px">
<input id="id_register_username" type="text" name="register_username" maxlength="25" />
<input type="text" name="register_email" id="id_register_email" />
<input type="password" name="register_password" id="id_register_password" />
<input type="password" name="register_password2" id="id_register_password2" /><br>
<button type="submit" class="btn">Submit</button>
</form>
这使得这个在Chrome:
Which renders to this in Chrome:
有什么可以导致此?我该如何解决?
What can be causing this? And how can I fix it?
推荐答案
这将出现一个类似的问题以前有人问:
It appears a similar question has been asked before:
<一个href=\"http://stackoverflow.com/questions/3306920/what-is-the-correct-way-to-stop-form-input-boxes-auto-completing\">What是正确的方式来阻止表单输入框自动完成?
有一个自动完成属性您可以在表单字段使用。
There is an autocomplete attribute you can use in form fields.
<input id="id_login_username" type="text" name="login_username" maxlength="25" autocomplete="off" />
这篇关于如何让Chrome尊重我的字段的名称,而不是试图自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文