Small circle apes share in HTML5 form how to turn off auto-complete function method

WEB front-end is now one of the more fire programming languages ​​nowadays, but for learning how to learn, or what many of my friends do not understand is, for the above small circle web front end apes lecturer summarized form method how to turn off AutoComplete feature? I hope you have some help on the front end of learning.

What is HTML5 form of auto-complete feature?

First of all, HTML5 has a new attribute autocomplete, autocomplete attribute specifies whether the form should enable auto-completion feature, which allows the browser to automatically predict the input field. When a user starts typing in the field, the browser-based typed before the value, should show the option to fill in the field.

Such as:

First name:
Last name:
E-mail:

Please complete and submit this form, then reload the page to see how the auto-complete function works.

Note that the form of autocomplete is open, and e-mail domain is closed.

Will find, autocomplete = "on" will be "recorded" while the E-mail autocomplete = "off", not "record" when entering again. This is the "HTML5 in the form of auto-complete" it!

How to turn off auto-complete

Sometimes we want to turn off auto-complete function of the input box, for example, when the input from the user, we want to use AJAX technology search from the database and list instead of searching in the history of the user.

Close the box autocomplete three ways:

1, the content in IE's Internet Options menu - Automatic completion which set
2, set the Form autocomplete to "on" or "off" to turn on or turn off the AutoComplete function
(shut down the entire form (form) automatically prompts)
3, input box setting (input) of autocomplete to "on" or "off" to turn on or off the autocomplete input box (the password field off automatically)

:( then submit the test code in each form to enter text, then come back and see if you can auto-complete, attention to the historical record to be submitted, it may be done automatically; after the page is submitted may be wrong, do not ignore it, that is to go back to back can)

Open the AutoComplete feature of Form

Open autocomplete input box
off autocomplete input box

Turn off the automatic completion of Form

Open autocomplete input box
off autocomplete input box

Recommendation: Do not turn off all auto-complete, according to the need to disable the auto-complete function can be a part of, if you think the browser that comes with auto-complete feature is not strong enough, you can use jquery plugins to achieve a more powerful automatic prompts to complete the function.

Small circle web front end apes lecturer said: teach him to fish more teach him to fish, you want to learn web front-end first need is to correct their attitude towards learning, clear learning objectives, so as to adhere to the study. For more on the front end of a small partner area, we can focus on dynamic small ape circle every day, occasionally update Internet programming knowledge, hope to have some help for you to learn.

Guess you like

Origin blog.csdn.net/weixin_44867000/article/details/92577010