2014-09-22 36 views
0

我有一個非常奇怪的問題,導致訪問者遇到很多問題。對文本框(在Chrome中)進行自動填充會導致預填充,而不會推送輸入

在普通文本框中,Chrome(以及其他瀏覽器)建議預填字符串。當您將它們懸停並移開鼠標時,它們不會被選中並寫入文本框中。

但是,在我的設置中,我有一個奇怪的情況。當我懸停我的選項,然後移動鼠標時,它會選擇框中的一個項目。這會導致很多「請輸入電子郵件」消息,而用戶在其屏幕上看到一封電子郵件。在這個視頻

見問題: https://www.youtube.com/watch?v=Vh2nb0_IR3Q

我給這家特定電子郵件標記:

<input type="text" name="Email" placeholder="E-mail" id="newUserEmail" class="email_input newinputtxt"> 

有沒有人有一個提示?因爲我真的失去了......

編輯:

完全ASP.NET MVC標記:

<asp:Content ID="Content1" ContentPlaceHolderID="plhMain" runat="server"> 
    <h2>Indtast e-mail adresse</h2> 
    <div class="checkout__section checkout__section--login checkout_auth"> 
      <div class="single_login"> 
       <div id="newUserBox"> 
        <div id="provideUserEmailBox"> 
         <div class="email_auth"> 
          <div> 
           <input type="text" name="Email" placeholder="E-mail" id="newUserEmail" class="email_input newinputtxt" /> 
          </div> 
          <span class="red auth-error-text" style="display: none;" id="invalidEmailText">Der skal indtastes en gyldig e-mail</span> 
           <ul class="red_checkmarks" style="margin-top: 5px;"> 
            <li>Vi bruger e-mail adressen til at sende en bekræftelse pa din ordre</li> 
            <li>Hvis du vil, kan du logge ind eller oprette en konto på næste side.</li> 
           </ul> 
         </div> 
        </div> 

        <div id="createNewUserBtnBox"> 
         <input id="newUserBtn" type="button" class="button button--primary" value="Fortsæt" /> 
         <span class="red auth-error-text" id="createNewUserErrorText"></span> 
        </div> 
       </div> 
      </div> 
      <div id="socialLoginList"> 
       <button class="pfacebook" type="button" name="provider" value="facebook" title="Log ind med din Facebook konto"> 
        Facebook 
       </button> 
       <button class="pgoogle" type="button" name="provider" value="google" title="Log ind med din Google konto"> 
        Google 
       </button> 
      </div> 
    </div> 
    <script type="text/javascript"> 
     $(function() { 
      $("#newUserEmail").keypress(function (event) { 
       if (event.keyCode == 13) { 
        event.preventDefault(); 
        $("#newUserBtn").click(); 
       } 
      }); 

      var auth = CheckoutAuthorizationFlow({ LoginUserBox: "#loginWithUserBox", NewUserBox: "#newUserBox" }); 
      auth.Init(); 

      var facebookLogin = function() { 

       var loginUrl = '/login?returnurl=' + encodeURIComponent(document.location.href) + '&r=' + (new Date().toUTCString()) + '&provider=facebook'; 

       //alert('facebook login'); 

       document.location.href = loginUrl; 
       return; 
      }; 

      var googleLogin = function() { 

       var loginUrl = '/login?returnurl=' + encodeURIComponent(document.location.href) + '&r=' + (new Date().toUTCString()) + '&provider=google'; 

       document.location.href = loginUrl; 
       return; 
      }; 
      $(".pfacebook").click(facebookLogin); 
      $(".pgoogle").click(googleLogin); 

     }); 
    </script> 
</asp:Content> 
+0

你已經標記了css,但是沒有類定義?此外,這是否只發生在鉻的這個錯誤? – 2014-09-22 16:29:59

+1

@MrCoder我爲CSS添加標籤的理由是因爲我可能懷疑CSS有這個原因,但這可能是一個非常愚蠢的想法。我沒有使用其他瀏覽器,所以我沒有能夠強制其他瀏覽器上的電子郵件建議 - 仍然嘗試使用數據庫的 – 2014-09-22 16:31:43

+0

? – jan199674 2014-09-22 16:39:56

回答

2

所以我的室友,誰一直有點與WordPress幾年回來,剛剛來到我的電腦,並說:

「把它包裹在表單標籤!」

所以我告訴他這是一個可怕的想法,他說「試試看」。

我做到了。

它他媽的工作。

So tl; dr - >將它包裹在表單標籤中,它可以工作...我會哭的。