How do you disable input value on web form field / input tag?

How do you disable Autocomplete in the major browsers for a specific input (or form field)?

          <input type="text" id="fullname" name="fullname" class="form-control" data-required="true" value="<?php echo $_POST['fullname']?>" >

When open this form i see value in this input but i dont insert any value.


Just use the autocomplete attribute:

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

"This would be useful when a text input is one-off and unique. Like a CAPTCHA input, one-time use codes, or for when you have built your own auto-suggest/auto-complete feature and need to turn off the browser default."

Source : CSS Tricks


i think adding autocomplete="off" would get you an error on most browsers, autocomplete="off" is an invalid property.

try checking this out instead

链接地址: http://www.djcxy.com/p/4500.html

上一篇: 如何为所有主流浏览器禁用自动完成功能

下一篇: 如何禁用Web表单域/输入标签的输入值?