开发者

How to cancel edit/disable cached input (of type text) value?

I have an input of type text, from which I have already entered value 1234

it has been saved in cache as shown below.

How to cancel edit/disable cached input (of type text) value?

The problem here is that, it is extremely frustrating to select the textbox in the next row.

Is there a way to not to di开发者_JS百科splay that 12334 (highlighted in the screenshot) from ever being displayed through HTML markup or javascript?


As @John pointed out, on modern browsers you can use the HTML5 valid autocomplete attribute, in your screenshot I see many textboxes, if you want to disable autocompletion on the whole form you can set this attribute directly at the form element:

<form name="form1" id="form1" method="post" autocomplete="off"
  action="http://www.example.com/form.action">
[...]
</form>

More info:

  • How to Turn Off Form Autocompletion


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


To apply this to all input controls, write the code below (using jQuery):

$(document).ready(function () {
    $('input[type=text], input[type=password]').attr('autocomplete', 'off');
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜