Menu

Showing posts with label HTML form. Show all posts
Showing posts with label HTML form. Show all posts

How to turn off form autocompletion using HTML

All modern browsers remember user's information that the user submits through HTML input fields on any websites. This helps users not to remember the information, or enables the browser to offer auto completion or auto fill.

Enable autocomplete or autofill


By default this is enable in all browsers. If not then you can explicitly allow autocomplete or at the time of development you can also set autocomplete on or off for the whole form of any particular field of the form using attribute autocomplete.

Possible values for autocomplete:

For a input type text : autocomplete="on"

Disable autocomplete


You can disable autocomplete by setting the autocomplete to off or false.

e.g.

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




In modern browsers autocomplete="off" not always works, specially we give consent to browser to store the login credential. In that case we can only prevent the autofill but not stop the autocomplete completely. For password fields we can set autocomplete="new_password" so that the login form will not prefilled even your credential will store on the browser's password manager.



References:

Turning off form autocompletion or autofill | Mozilla Developer

 

Student registration form in HTML

Create a simple student registration form using HTML. This form should have option to fill the following:
  1. Student Name
  2. Student Email
  3. Program Type
  4. Interested in doing which course
  5. Day preference
  6. Submit and Clear button  

Below is the HTML code. You could copy and paste the complete content and run in your machine.

You HTML form will look like as below:

Student registration form


Hope this helps you to create and understand the different input fields of HTML and how to develop a HTML form using all kind of input fields.