1

我有 Drupal 站点,我尝试禁用由浏览器(如 Firefox)生成的自动完成功能。我在表单/输入中输入了 Autocomplete="false" 但没有任何反应,我总是得到自动完成。

这是我的代码

<form id="tools-form" accept-charset="UTF-8" method="post" action="/" autocomplete="false">
<div>
<div class="form-item form-type-select form-item-field-specialites">
<input type="hidden" value="form-SRCZMjW2TL0BmIMj1iFynwQk4_QmrVgFr8zzTSIh_a8" name="form_build_id">
<input type="hidden" value="tools_form" name="form_id">
<div class="form-item form-type-radios form-item-field-pays">
<div class="form-item form-type-textfield form-item-field-code-postal" role="application">
<label for="edit-field-code-postal">
<input id="edit-field-code-postal" class="form-text required form-autocomplete" type="text" maxlength="128" size="60" value="" name="field_code_postal" autocomplete="OFF" aria-autocomplete="list">

这是我的代码

<form id="tools-form" accept-charset="UTF-8" method="post" action="/" autocomplete="false">
<div>
<div class="form-item form-type-select form-item-field-specialites">
<input type="hidden" value="form-SRCZMjW2TL0BmIMj1iFynwQk4_QmrVgFr8zzTSIh_a8" name="form_build_id">
<input type="hidden" value="tools_form" name="form_id">
<div class="form-item form-type-radios form-item-field-pays">
<div class="form-item form-type-textfield form-item-field-code-postal" role="application">
<label for="edit-field-code-postal">
<input id="edit-field-code-postal" class="form-text required form-autocomplete" type="text" maxlength="128" size="60" value="" name="field_code_postal" autocomplete="OFF" aria-autocomplete="list">
4

2 回答 2

2

你可以发布一个例子吗?

还可以尝试以下方法:

<input type="text" autocomplete"off" />

Mozilla建议使用"off"not "false"

于 2013-01-31T18:26:36.287 回答
0

在 Firefox 中,您可以使用 AutoComplete ="off"

http://www.hanselman.com/blog/TurningOffAutoCompleteForTextBoxesInIEAndFireFox.aspx

于 2013-01-31T18:25:53.880 回答