2013-06-12 152 views
2

我有一個表單,我無法使用Chrome自動填充。有3個輸入雖然填充雖然..爲什麼Chrome自動填充不填充大多數字段

電話號碼,電子郵件和公司名稱都是他們應該的工作。我嘗試將x-autofilltype添加到其他字段,但沒有任何反應。有沒有比這更好的方法?

這裏是我的代碼的一部分(注意,這是來自我的PHP的HTML):

<div class="checkout_holder"> 
<div class="contentText"> 
     <div class="checkout_float_left"> 
      <input type="text" name="email" value="E-Mail" style="width:295px;" title="E-Mail" />  
     </div> 
     <div class="checkout_float_left"> 
      <input type="text" name="phone" value="Phone Number" style="width:295px;" title="Phone Number" />  </div>  
     </div> 
</div><!-- eof contact info --> 

<div class="checkout_holder"> 
    <h2 class="checkout">Billing Address</h2> 
    <div class="contentText"> 
      <div class="checkout_float_left"> 
       <select name="bill_country_id" style="width:301px;border:1px solid #bbb;"> 
       <option value="0">Please Select Your Country</option> 
       <option value="1">Afghanistan</option> 
       etc. 
       </select>  
      </div> 

     <div class="checkout_float_left"> 
      <input type="text" name="bill_firstname" value="First Name" style="width:140px;" title="First Name" x-autocompletetype="given-name" />  
     </div> 
     <div class="checkout_float_left"> 
      <input type="text" name="bill_lastname" value="Last Name" style="width:140px;" title="Last Name" />  
     </div> 
     <div class="checkout_float_left"> 
      <input type="text" name="bill_company" style="width:295px;color:#bbb;" placeholder="Company" title="Company" />  
     </div> 
     <div class="checkout_float_left"> 
      <input type="text" name="bill_address" value="Street Address" style="width:295px;" title="Street Address" />   
     </div> 
     <div class="checkout_float_left"> 
      <input type="text" name="bill_address2" style="width:295px;color:#bbb;" placeholder="Apt, Suite, etc" title="Apt, Suite, etc" />   
     </div> 
     <div class="checkout_float_left"> 
      <input type="text" name="bill_city" value="City" style="width:295px;" title="Postcode" />  
     </div> 
     <div class="checkout_float_left" id="states"> 
      <select name="bill_state" style="width:301px;border:1px solid #bbb;padding:2px 0;" id="bill_state"> 
      <option value="0" SELECTED>Please Select Your State</option> 
      <option value="Alberta">Alberta</option> 
      </select> 
     </div>  
     <div class="checkout_float_left"> 
      <input type="text" name="bill_postcode" value="Postcode" style="width:295px;" title="Postcode" /> 
     </div> 

     </div><!-- eof contentText --> 
</div> 
+0

Chrome自動填充使用上下文線索來確定要填寫的表單域。我敢打賭,你所有表單名稱的前綴都搞亂了。嘗試'lname','fname','address'而不是'bill_ *' – phpisuber01

+0

可能的重複[如何在Google Chrome中觸發自動填充?](http://stackoverflow.com/questions/7223168/how-to-trigger -autofill-in-google-chrome) – takeshin

+0

也許這個問題是這個問題的重複:[如何在Google Chrome中觸發Autofill?](http://stackoverflow.com/questions/7223168/how-to-trigger-autofill在谷歌瀏覽器中如何觸發自動填充?](https:/ /谷歌瀏覽器) [by [Brent Washburne](http://stackoverflow.com/users/584846/brent-washburne)] – hakre

回答

-1

如果我沒有記錯Chrome的自動填充匹配的類型或名稱字段就像我們使用的上下文線索在讀的時候。嘗試將您的字段從bill_ *重命名爲*。即bill_firstname - >名字