Turn off autocomplete in Laravel

✔ Recommended Answer

You could do

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

EDIT: only works for jquery

Source: stackoverflow.com

Answered By: Marcus

Method #2

To turn off autocomplete in Laravel, you can use the autocomplete="off" attribute on the form input fields. Here's an example:

html
<form method="post" action="/submit"> @csrf <input type="text" name="name" autocomplete="off"> <input type="password" name="password" autocomplete="off"> <button type="submit">Submit</button> </form>

In this example, we use the autocomplete="off" attribute on the name and password input fields to turn off autocomplete. This will prevent the browser from automatically filling in these fields with previously entered values.

Note that some browsers may ignore the autocomplete="off" attribute for security reasons, so it is not 100% reliable. However, it is still a recommended practice to use it to reduce the risk of sensitive information being exposed through autocomplete.

Comments

Most Popular

Remove Unicode Zero Width Space PHP

PhpStorm, return value is expected to be 'A', 'object' returned

Laravel file upload returns forbidden 403, file permission is 700 not 755