hudi
hudi

Reputation: 16555

How to control auto form fill

my question is how to control fill entries in textfield.

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

In my app I have page with login form which have username textField. Then I have registration page with email textField. Now I have problem that firefox rember entries which I enter to username textField also in email textField. But when I enter value to email textField firefox does rember it. Same with chrome browser

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>

form2

<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>

Upvotes: 0

Views: 270

Answers (1)

Robert Niestroj
Robert Niestroj

Reputation: 16151

In your HTML add the attribute autocomplete="off" to input fields where you dont want browsers to remember that information. For example:

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

EDIT: 02.2018: Browser behavior changed over time and now for login and password fields autocomplete off is not supported in modern browsers: https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields

Upvotes: 2

Related Questions