So, I searched for a while to see if I can disable the yellow color bg chrome adds to fields it remembers... This is a little annoying to my theme.
I found this code that fixes it!
<script type="text/javascript">
$(function() {
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
var intervalId = 0;
$(window).load(function() {
intervalId = setInterval(function () { // << somehow this does the trick!
if ($('input:-webkit-autofill').length > 0) {
clearInterval(intervalId);
$('input:-webkit-autofill').each(function () {
var text = $(this).val();
var name = $(this).attr('name');
$(this).after(this.outerHTML).remove();
$('input[name=' + name + ']').val(text);
});
}
}, 1);
});
}
});
</script>
The issue is this little flash of yellow when you try it
Also here is my form....
<form action="login.php" method="post" class="form-container">
<input class="menu_button" type="submit" value="Login">
<a href="register.php" class="menu_button">Register</a><br>
<input autocomplete="off" class="form-field" value="Username" type="text" name="username" onfocus="if (this.value=='Username') this.value='';"/><br />
<input class="form-field" value="Password" type="password" name="password" onfocus="if (this.value=='Password') this.value='';"/><br />
</form>
Is this simply because Chrome has glitches with it or something of that sort....
Is it even possible to fix?