Chrome会自动填写包含错误数据的表单

时间:2017-02-14 19:25:04

标签: angularjs forms google-chrome autofill

我的注册页面上有一个表单,允许用户创建他们的帐户。如果创建帐户请求成功,我的角度会将用户重定向到登录视图。当用户登陆此处时,它会自动使用上一个表单中的姓氏填写用户名/电子邮件字段。

我不太确定为什么。表单都具有相同的ID和名称值,因此我对Chrome自动填充感到非常困惑。

在注册帐户后,用户被重定向到登录页面,找到了一些东西。它会自动将姓氏填入用户名框,然后正确填充密码。但是,如果您清除姓氏并使用正确的凭据登录,则会更新Google Save Locker记录并从该点开始正常工作。

以下是我所看到的视觉示例。

注册: Filling out form so you can see the last name value

注册后重定向到登录页面: The UI chrome displays after landing on login page

链接到实例的页面: 网站链接:app.baileysproject.com

注册表格:

<form class="form-horizontal" id="RegisterForm">
            <fieldset>


                <!-- Text input-->
                <div class="form-group">
                    <label class="col-md-4 control-label" for="Email">Email</label>
                    <div class="col-md-4">
                        <input id="Email" name="Email" type="email" placeholder="Email Address" class="form-control input-md" ng-model="stuff.Email" required="">
                        <span class="help-block">A valid email address</span>
                    </div>
                </div>

                <!-- Text input-->
                <div class="form-group">
                    <label class="col-md-4 control-label" for="FirstName">First Name</label>
                    <div class="col-md-4">
                        <input id="FirstName" name="FirstName" type="text" placeholder="First Name" class="form-control input-md" ng-model="stuff.FirstName" required="">
                        <span class="help-block">Your first name</span>
                    </div>
                </div>

                <!-- Text input-->
                <div class="form-group">
                    <label class="col-md-4 control-label" for="LastName">Last Name</label>
                    <div class="col-md-4">
                        <input id="LastName" name="LastName" type="text" placeholder="Last Name" class="form-control input-md" ng-model="stuff.LastName" required="">
                        <span class="help-block">Your last name</span>
                    </div>
                </div>

                <!-- Password input-->
                <div class="form-group">
                    <label class="col-md-4 control-label" for="Password">Password</label>
                    <div class="col-md-4">
                        <input id="Password" name="Password" type="password" placeholder="Password" class="form-control input-md" ng-match="stuff.Password" ng-model="stuff.Password" required="">
                        <span class="help-block">Enter a strong password</span>
                    </div>
                </div>

                <!-- Password input-->
                <div class="form-group">
                    <label class="col-md-4 control-label" for="cPassword">Confirm Password</label>
                    <div class="col-md-4">
                        <input id="cPassword" name="cPassword" type="password" placeholder="Password" class="form-control input-md" ng-model="stuff.ConfirmPassword" required="">
                        <span class="help-block">Enter the same password again</span>
                    </div>
                </div>

                <!-- Button -->
                <div class="form-actions">
                    <div class="">
                        <button id="CreateAccount" name="CreateAccount" ng-click="CreateAccount()" class="btn btn-info">{{AccountCreatedValue}}</button>
                    </div>
                </div>

            </fieldset>
        </form>

登录表单:

<form class="form-horizontal">
            <fieldset>
                <!-- Text input-->
                <div class="form-group">
                    <label class="col-md-4 control-label" for="Email">Email</label>
                    <div class="col-md-4">
                        <input id="Email" name="Email" type="email" placeholder="Email Address" class="form-control input-md" ng-model="Email" required="">
                        <span class="help-block">A valid email address</span>
                    </div>
                </div>

                <!-- Password input-->
                <div class="form-group">
                    <label class="col-md-4 control-label" for="Password">Password</label>
                    <div class="col-md-4">
                        <input id="Password" name="Password" type="password" placeholder="Password" class="form-control input-md" ng-model="Password" required="">
                        <span class="help-block">Strong Password</span>
                    </div>
                </div>

                <!-- Button -->
                <div class="form-actions">
                    <div class="">
                        <button id="Login" name="Login" ng-click="Login()" class="btn btn-info">Login</button>
                    </div>
                </div>

            </fieldset>
        </form>

0 个答案:

没有答案