Hey developers! In this article, we will see how to set up autocomplete in Angular HTML form for chrome. We are going to run an Angular Project with a general HTML form containing a few typical fields. Then we will see how to enable and disable autocomplete for those fields. We will also check out the specific autocomplete values that you would expect. So, without any further delay, let’s get into it.
Prerequisites
- Should have Angular project running (Learn How)
Table of Content
- Adding Autofill content in Chrome
- Running an Angular Project with HTML Form
- Enable and Disable Autocomplete in HTML Form
STEP 1: Adding Autofill Content in Chrome
Firstly, we will add a few autofill contents in the chrome browser so that chrome has something to suggest for the autofill. For this, go to Settings > Autofill > Addresses and more.
Here you click on Add button and start filling random values in the fields that it shows. Take reference from the image below. Once done, click on save. Now we move to our next step.
STEP 2: Angular Project with HTML Form
As mentioned earlier in the prerequisite, you should have a basic Angular project up and running. If you’re having problems with that, check out this article to create Angular project from scratch. Next, you need to create a basic HTML form with a few fields. So, simply copy the following HTML form in “app.component.html” file in Angular.
Then simply start your Angular Project with this command:
ng serve
This should be the output on your browser as shown in the image below. In the image, the autofill is also shown.
STEP 3: Enable/Disable Autocomplete in Chrome
1) Enable Autocomplete in HTML Form
As shown earlier, we only had to add the autofill content in Chrome for it to show us autofill suggestions. By default, autocomplete feature is enabled in every HTML form.
However, there is one thing you need to make sure of. You need to add the ‘name’ attribute for each of the input fields in HTML form. With the name attribute, the browser identifies the type of suggestions to give for that field. And it would only give suggestions according to the Autofill Content that we’ve added in Step 1. Take reference from the image below:
2) Disable Autocomplete in HTML Form
There are 2 ways to disable autocomplete in HTML form. First is the proper way but sometimes, it might now work for some frameworks. So, let’s check them out.
A) Method #1:
autocomplete='off'
Simply add autocomplete=’off’ in the form tag in your HTML. See the image below.
The above method will disable autocomplete for ALL the input fields in the form. But if you want to disable autocomplete for a specific input field only, then add the autocomplete=”off” code for specific fields as shown below.
B) Method #2:
This is kind of a hack for disabling the autocomplete feature in chrome. You can do this by simply giving a random value to the ‘name’ attribute of your input fields. As mentioned in the 1st method when we were enabling autocomplete. The autocomplete is triggered when it identifies the type of input filed. And it does that with the ‘name’ attribute.
So, logically speaking, if we give an input field a faulty name, then the chrome autocomplete would not trigger. So basically, this hack is not disabling the autocomplete feature. It’s simply making the browser ignore the suggestion for the input field. As it would not understand that type of suggestions to give. And it can only suggest according to the Autofill content that we added in Chrome in step 1. Check the image for reference.
That’s a wrap!
I hope this article helped you figure out exactly how to enable or disable autocomplete in HTML form. I hope it made you confident enough to start using this in your next project. Please leave your reviews in the comment section below.
Have a great one!
Recent Posts
- Zonder Cruks Online Casino Veiligheid en beveiliging van spelers.1175
- Fortune Favors the Bold – Can You Lead Your Clucky Companion Down the Chicken Road & Cash Out Before
- Verfrissend Gokken met nieuwe online casino zonder cruks – Een Nieuwe Ervaring
- Elevate Your Play Find the best australian online casino Experiences with Lucrative Bonuses & Secure
- Lopebet’s Multi-Bet Options: How and When to Use Them
Recent Comments
Archives
- May 2026
- October 2025
- August 2025
- June 2025
- October 2024
- September 2024
- August 2024
- June 2023
- May 2023
- March 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
Categories
- Angular
- AWS
- Backend Development
- Big Data
- Casino
- Cloud
- Database
- Deployment
- DevOps
- Docker
- Frontend Development
- GitHub
- Google Cloud Platform
- Installations
- Java
- JavaScript
- Linux
- MySQL
- Networking
- News
- NodeJS
- Online casino
- Operating System
- Post
- Python
- Python Flask
- Report
- Security
- Server
- SpringBoot
- Subdomain
- TypeScript
- Uncategorized
- VSCode
- Webhosting
- WordPress
Search
Recent Post
Zonder Cruks Online Casino Veiligheid en beveiliging
- 18 May, 2026
- 5 min read
Fortune Favors the Bold – Can You
- 15 May, 2026
- 6 min read
Verfrissend Gokken met nieuwe online casino zonder
- 14 May, 2026
- 6 min read