Disable autocomplete in google chrome

I had to work with html form. When I tried to fill Email address it autofills with yellow coloured boxes.
(See the Image below.)

I need to get avoid from this issue. I have added following code snippet. but it does not work for me.

<input id="email" name="email" value="" autocomplete="off"

So I have to find another solution. I have added autocomplete property to form and added following jquery.


$('form[autocomplete="off"] input, input[autocomplete="off"]').each(function() {
var input = this;

var name = $(input).attr('name');
var id = $(input).attr('id');

$(input).removeAttr('name');
$(input).removeAttr('id');

setTimeout(function() {
$(input).attr('name', name);
$(input).attr('id', id);
}, 1);
});


After that, It worked for me ! Cheers !

0 comments:

Post a Comment

Ask anything about this Tutorial.