2014-02-14 82 views
0

我的問題是如何控制文本字段中的填充條目。如何控制自動填寫表格

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

在我的應用我有具有用戶名文本框登錄表單頁面。然後我有電子郵件textField的註冊頁面。現在我有問題,我輸入到用戶名textField也在電子郵件textField中的Firefox重新整理條目。但是,當我輸入電子郵件textField firefox的價值確實rember它。同樣的,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> 

回答

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

+0

這不是爲我工作 我有便門-1.3.7.jar

+0

瀏覽器行爲隨時間而改變,現在用於登錄和密碼字段autocomplete off支持:https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_a nd_login_fields –

+0

我使用chrome v64 –