Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to autocomplete the user's first name in an HTML input box?

Tags:

html

forms

I have a simple bootstrap form. In this form, in the first input box, I ask for name. I want to enable autocomplete. The user shall be able to select the first name, like a form where if you click you have all data the user usually enters in similar forms. How can I achieve that?

<input type="text" class="form-control" id="name" aria-required="true">
like image 579
pette Avatar asked Oct 18 '25 12:10

pette


1 Answers

There is an attribute called autocomplete on HTML tags that are related to forms. For the first name you could specify autocomplete="given-name" and for the last name you could use autocomplete="family-name".

There is more information at MDN Web Docs

like image 144
Dirogers Avatar answered Oct 21 '25 02:10

Dirogers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!