在浏览器中禁用自动填充表单

时间:2013-01-31 18:17:38

标签: drupal autocomplete

我有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">

2 个答案:

答案 0 :(得分:2)

你能发一个例子吗?

同时尝试以下方法:

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

Mozilla 建议使用"off"而不是"false"

答案 1 :(得分:0)

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

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