5

I have a site on Laravel. It has a big amount of text inputs. So, I want to disable autocomplete for all of text inputs, I know about "autocomplete=off", but it's too long to add it to all of my forms! Is the simpler solution exists?

1

3 Answers 3

6

You can append

autocomplete="off"

to your form to get this behavior.

<form method="POST" autocomplete="off">
// ... all inputs
</form>
0
1

add the attribute autocomplete="new-password" <input type="text" autocomplete="new-password">

3
  • your solution works but please add a brief explanation or reference May 3, 2023 at 8:00
  • <input type="text" autocomplete="new-password"> the value new-password is telling to the browser to not fill it by value registered in cookies May 4, 2023 at 10:04
  • edit your answer and update it with explanation and provide any reference if possible May 4, 2023 at 15:23
0

You could do

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

EDIT: only works for jquery

1
  • 1
    May want to add this solution requires jquery, since jquery shouldn't be assumed to be included in their project. Jul 23, 2018 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.