3 ways to disable autocomplete on your forms

David Carr

1 min read - 21st Oct, 2012

Here are 3 ways to stop forms remember what has previosuly been entered into them, the fist way is to enter autocomplete="off" into the input you want to disable autcomplete for.

<input type="text" name="firstName" value="" autocomplete="off">

Another way is to apply autcomplete off to the form to disable autocomplete on all the forms inputs.

<form autocomplete="off">

Lastly you can disable autocomplete to all inputs using jQuery.

$(document).ready(function(){ 
    $("input").attr("autocomplete", "off"); 
});

 

0 comments
Add a comment

Copyright © 2024 DC Blog - All rights reserved.