Use autocomplete to complete the cache and prompt of the text box


foreword

In the recent development, I have encountered the problem of text box input, but the user also wants to cache the history and prompt.
Eventually, it was resolved by using the autocomplete attribute.


1. What is autocomplete?

Autocomplete means that when the user enters the first few letters or Chinese characters in the text box, the control can prompt the user with all the data starting with these letters from the text or database where the data is stored, for the user to choose and provide convenience.

The attribute value of the autocomplete attribute:

value describe
on default. Specifies that autocomplete is enabled. The browser autocompletes the value based on what the user typed in earlier.
off Specifies to disable autocomplete. The user must enter a value into each field each time it is used, the browser will not autocomplete the entry.

2. Use steps

In a regular input component, add name and autocomplete="on" and
the browser will match the corresponding data according to the value of name, so the same data cache is required, and the same name value needs to be used
. Example:

<input name="XXX" autocomplete="on" ></input>

Summarize

Received positive feedback from customers!
insert image description here

Guess you like

Origin blog.csdn.net/YIGE_MO/article/details/128813175