2

In my case. I have login form for sign up the form has some field like phone-number, e-mail address, password etc.. after sign up when the user want to login the requirement is e-mail address and password. Chrome automatically filled the fields password field is ok but in the e-mail field automatically phone number pasted.

How do i configure this ?

The shots shows chrome credential when i sign up the site. enter image description here

Last one is true i want to saved like last one.

Form markup, that's the form phone and e-mail inputs code

@Html.TextBoxFor(m => m.Email, new { @class = "SSTinputTextE input", placeholder = "E-POSTA ADRESİ" })
@Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger", @style = "display:none" })

@Html.TextBoxFor(m => m.Phone, new { @class = "SSTinputTextE input txtNumeric", placeholder = "CEP TELEFONU", maxlength = "11" })
@Html.ValidationMessageFor(m => m.Phone, "", new { @class = "text-danger ", @style = "display:none" })

enter image description here

abbays
  • 65
  • 8
  • Please add markup of your login form. – Zeeshan May 03 '16 at 08:14
  • Also please review [How can I get browser to prompt to save password?](http://stackoverflow.com/questions/2382329/how-can-i-get-browser-to-prompt-to-save-password) – Zeeshan May 03 '16 at 08:23
  • can it be interested about sorting of login form. Example password's input type is password so its saved as right but before password i have phone number as a text input type maybe the browser saved phone number because of it. when it was work clear. i didnt have phone number field and before password input type had e-mail that's why i am thought it – abbays May 03 '16 at 08:58

1 Answers1

2

I had the exact same problem in a .Net MVC site with very similar markup. I also use placeholder attributes on the input element itself, instead of label elements before the element—just like the op.

I fixed the problem by moving the phone number field before the email field in the HTML (and form visually, if that matters).

I didn't dig into it enough to figure out the exact reason for this definitively, but I suspect it was because it was picking up the first input field after anything with the word "email" in it. Since there wasn't a label for the phone number to interrupt this logic, the phone number field was next so it chose that. I know Chrome uses some simple regex for picking up these auto save fields, so maybe its just not clever enough to realize that placeholders on the element itself can count too? (Again, this is just a guess at the reason. But my workaround above worked anyway.)

Jon Adams
  • 24,464
  • 18
  • 82
  • 120