0

This is my code in laravel 5.8: i load 1 table and allow input:

 <td><input autocomplete="off" class="inputdata" name="userid" type="text" value="{{$row->userid}}" disabled="true"/></td>
     <td><input autocomplete="off" class="inputdata" name="email" type="text" value="{{$row->email}}"/></td>
     <td><input autocomplete="off"  class="inputdata"name="name" type="text" value="{{$row->name}}"/></td>
    <td><input autocomplete="off" class="inputdata" name="phonenumber" type="text" value="{{$row->phonenumber}}"/></td>
   <td><input autocomplete="off" class="inputdata" name="company" type="text" value="{{$row->company}}"/></td>

enter image description here At Red Frame, it auto fill a value ( it is username)

I had add : autocomplete="off", but this can't resolve.

How turn off autofill of input text? I using Google Chrome.

D T
  • 2,530
  • 7
  • 30
  • 66
  • 1
    check this answer https://stackoverflow.com/questions/15738259/disabling-chrome-autofill chrome (for some reason i don't know) sometimes ignores `autocomplete="off"` – ciekals11 Aug 23 '19 at 08:57
  • i try autocomplete="false", autocomplete="new-password", it still not ok. – D T Aug 23 '19 at 09:08

3 Answers3

1

you have use jquery to off the autofill input text... **try this code using jquery and add all js and css i think you can get your answer very easily.. **

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

or

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

or

$(document).ready(function(){
    $(':input').live('focus',function(){
        $(this).attr('autocomplete', 'off');
    });
});
Vikas Katariya
  • 4,703
  • 3
  • 7
  • 28
1

Try this advices:

 1. Add autocomplete="off" onto <form> (or try do it on <table>) 
    element;

 2. Add hidden <input> with autocomplete="false" as a first children
        element of the form.
0

//Just use this two line for text field and number field in your from footer.

$(document).ready(function() {

$('input[type=text]').attr('autocomplete','off');
$('input[type=number]').attr('autocomplete','off');

});
Gm Farook
  • 1
  • 2