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
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
Post a Comment