5

Okay, this is the story so far.

I have a login form with label overlays that hide when values are entered.
This all works fine but on chrome the autofill doesn't trigger anything.

So i rustled up the following workaround, but when i tried the remove the alert it stops working???

$(window).load(function(){
   alert();
   if($('input:-webkit-autofill').val()){
      $("label[for='user'], label[for='pass']").css("visibility", "hidden");   
   }        
});

I've tinkered with it for an hour or two now and nothing. Any ideas?

gustavodidomenico
  • 4,640
  • 1
  • 34
  • 50
Tracey Turn
  • 598
  • 4
  • 15
  • 1
    This may help in your search for an answer? http://stackoverflow.com/questions/11708092/detecting-browser-autofill – Undefined Jan 31 '13 at 17:27
  • Thanks for your reply Sam. I had read through this and by it's own admittance, dosent resolve the issue. – Tracey Turn Feb 01 '13 at 10:45

1 Answers1

3
$(document).ready(function (e) {
    setTimeout(function () {
        if ($('input#username:-webkit-autofill').val()) {
            console.debug($('input#username:-webkit-autofill').val());
        }
    }, 25);
});

This is my workaround =]
Hope this helps.

dbaourdos
  • 139
  • 1
  • 3