Currently seeking new career opportunities in web development, particularly with Laravel, Hire Me

3 ways to disable autocomplete on your forms

David Carr

Javascript Htaccess Tutorials

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"); 
});

 

Laravel Modules Your Logo Your Logo Your Logo

Become a sponsor

Help support the blog so that I can continue creating new content!

Sponsor

My Latest Book

Modular Laravel Book - Laravel: The Modular way

Learn how to build modular applications with Laravel Find out more

Subscribe to my newsletter

Subscribe and get my books and product announcements.

Learn Laravel with Laracasts

Faster Laravel Hosting

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.