-2

Currently having an issue where websites are not asking to save my credentials. I kept the type="button" because we are calling a function in js. Any ideas as to why it may not be working?

                <form>
                    <div class="card card-default p-4">
                        <div class="form-group">
                            <label class="m-0 text-bold">Username</label>
                            <input required type="text" class="form-control" placeholder="example@domain.com" data-bind="value: username">
                        </div>

                        <div class="form-group">
                            <label class="m-0 text-bold">Password</label>
                            <input required type="password" class="form-control" placeholder="" data-bind="value: password" autocomplete="on">
                        </div>

                        <div class="form-group mt-2">
                            <div class="row">
                                <div class="col-md-6 col-lg-5">
                                    <button class="btn btn-block btn-outline-primary m-0" type="button" data-bind="click: signin">LOGIN</button>
                                </div>
                                <div class="col-md-6 col-lg-7 mt-2 mt-md-0 d-flex align-items-center">
                                    <a class="forgot-password" href="#forgotpassword">Forgot password?</a>
                                </div>
                            </div>
                        </div>
                    </form>
  • Is the Username saved but not the password? Do you realize what autocomplete="on" does? – Randy Casburn Apr 16 '18 at 19:29
  • No, the username nor password is not saved. I read one another post that this issue might help resolve this issue with IE as autocomplete is off by default. – Cole Perrault Apr 16 '18 at 19:34
  • Do you mean in general or only for your site? What browser? If you're using Firefox, make sure that you are allowing credentials to be saved in the security panel: `about:preferences#security`. – zero298 Apr 16 '18 at 19:37
  • Read this: https://blogs.msdn.microsoft.com/ieinternals/2009/09/10/why-wont-ie-remember-my-login-info/ :Good luck. – Randy Casburn Apr 16 '18 at 19:39
  • I mean only for my site. I am QA this site to have cross browser support – Cole Perrault Apr 16 '18 at 19:51

1 Answers1

1

If I remember correctly username & password 'autofill' is not standardized across browsers. The individual browsers detect name attributes in the form. Check out this article for Chrome browser. https://developers.google.com/web/updates/2015/06/checkout-faster-with-autofill

I've found from past experience is setting

name="username" & name="password" generally makes autofill work on most browsers.

   <form>
    <div class="card card-default p-4">
        <div class="form-group">
            <label class="m-0 text-bold">Username</label>
            <input name="username" required type="text" class="form-control" placeholder="example@domain.com" data-bind="value: username">
        </div>

        <div class="form-group">
            <label class="m-0 text-bold">Password</label>
            <input name="password" required type="password" class="form-control" placeholder="" data-bind="value: password" autocomplete="on">
        </div>

        <div class="form-group mt-2">
            <div class="row">
                <div class="col-md-6 col-lg-5">
                    <button class="btn btn-block btn-outline-primary m-0" type="button" data-bind="click: signin">LOGIN</button>
                </div>
                <div class="col-md-6 col-lg-7 mt-2 mt-md-0 d-flex align-items-center">
                    <a class="forgot-password" href="#forgotpassword">Forgot password?</a>
                </div>
            </div>
        </div>
</form>
Malcor
  • 2,667
  • 21
  • 29