如何控制自动填表

问题描述 投票:0回答:1

我的问题是如何控制文本字段中的填充条目。

http://support.mozilla.org/en-US/kb/control-firefox-automatically-fills-in-forms

在我的应用程序中,我有登录表单的页面,其中包含用户名textField。然后我有电子邮件textField的注册页面。现在我有问题,我输入用户名textField的firefox rember条目也在电子邮件textField中。但是当我输入值给电子邮件textField时,firefox会重新登录它。与chrome浏览器相同

Form1中

<form wicket:id="signInForm">
            <table>
                <tr>
                    <td align="right"><wicket:message key="username">
            Username
        </wicket:message></td>
                    <td><input wicket:id="username" type="text" /></td>
                </tr>
                <tr>
                    <td align="right"><wicket:message key="password">
            Password    
        </wicket:message></td>
                    <td><input wicket:id="password" type="password" /></td>
                </tr>
                <tr wicket:id="rememberMeRow">
                    <td></td>
                    <td><input wicket:id="rememberMe" type="checkbox" /> Remember
                        Me</td>
                </tr>
                <tr>
                    <td></td>
                    <td><input class="tournamentButton" type="submit"
                        wicket:id="signIn" value="Sign In" /> <input class="tournamentButton"
                        type="reset" value="Reset" /> <input class="tournamentButton"
                        type="submit" wicket:id="register" value="Register" /></td>
                </tr>
            </table>
        </form>

窗口2

<form class="userform" wicket:id="userEditForm">
    <fieldset>
        <legend>
            <wicket:message key="user">
        User
    </wicket:message>
        </legend>
        <div>
            <label wicket:for="name"><wicket:message key="name">
        Name:
    </wicket:message></label><input type="text" wicket:id="name" />
        </div>
        <div>
            <label wicket:for="surname"><wicket:message key="surname">
        Surname:
    </wicket:message></label><input type="text" wicket:id="surname" />
        </div>
        <div>
            <label wicket:id="userNameLabel" /> <input type="text"
                wicket:id="userName" />
        </div>
        <div>
            <label wicket:for="email"><wicket:message key="email">
        Email:
    </wicket:message></label><input type="email" wicket:id="email" />
        </div>
        <div>
            <label wicket:for="password"><wicket:message key="password">
        Password:
    </wicket:message></label><input type="password" wicket:id="password" />
        </div>
        <div>
            <label wicket:for="confirmPassword"><wicket:message
                    key="confirmPassword">
        Confirm Password:
    </wicket:message></label><input type="password" wicket:id="confirmPassword" />
        </div>
        <div>
            <label wicket:id="platnostLabel" /> <input type="text"
                wicket:id="platnost" />
        </div>
        <div>
            <label wicket:id="roleLabel" /><input type="text" wicket:id="role" />
        </div>
    </fieldset>

    <div>
        <input class="tournamentButton" type="submit" wicket:id="submit"
            value="Save" /> <input class="tournamentButton" type="submit"
            wicket:id="back" title="back" value="Back" />
    </div>

</form>
html wicket
1个回答
2
投票

在您的HTML中,将属性autocomplete="off"添加到您不希望浏览器记住该信息的输入字段。例如:

<input type="text" autocomplete="off" wicket:id="userName" />

编辑:02.2018:浏览器行为随时间而变化,现在登录和密码字段自动完成关闭在现代浏览器中不受支持:https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields

© www.soinside.com 2019 - 2024. All rights reserved.