Why this suggestion is only in the email input











up vote
0
down vote

favorite












Hello i have a form with different input fields.



i want to know why only the suggestions ( autocomplete ) of the email input contain the email of my connection page and password saved by chrome.



i have try to delete the id="email" and the name="email" also the data annotations but suggestions appear also only for this input.



finally i want to disable this suggestion in this input i have tried also with autocomplete attribute but i have the same problem.



Here my code html :






<div class="col-6">
<label class="col-12 px-2 mdc-text-field">
@Html.TextBoxFor(model => model.Email, new { @class = "mdc-text-field__input", @style = "padding-left: 20px;" })
<span class="mdc-floating-label" style="padding-left: 20px;">Mail</span>
<div class="mdc-text-field__bottom-line"></div>
</label>
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</div>





Here my model :



 [Required(ErrorMessage = "L'adresse mail est obligatoire")]
[RegularExpression("^[a-zA-Z0-9_\.-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,100}$", ErrorMessage = "E-mail invalide")]
public string Email { get; set; }









share|improve this question






















  • It sounds like the browser is performing the autocomplete not the website/JavaScript
    – phuzi
    Nov 15 at 14:51










  • @phuzi maybe yes
    – mecabpazzo95
    Nov 15 at 14:55















up vote
0
down vote

favorite












Hello i have a form with different input fields.



i want to know why only the suggestions ( autocomplete ) of the email input contain the email of my connection page and password saved by chrome.



i have try to delete the id="email" and the name="email" also the data annotations but suggestions appear also only for this input.



finally i want to disable this suggestion in this input i have tried also with autocomplete attribute but i have the same problem.



Here my code html :






<div class="col-6">
<label class="col-12 px-2 mdc-text-field">
@Html.TextBoxFor(model => model.Email, new { @class = "mdc-text-field__input", @style = "padding-left: 20px;" })
<span class="mdc-floating-label" style="padding-left: 20px;">Mail</span>
<div class="mdc-text-field__bottom-line"></div>
</label>
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</div>





Here my model :



 [Required(ErrorMessage = "L'adresse mail est obligatoire")]
[RegularExpression("^[a-zA-Z0-9_\.-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,100}$", ErrorMessage = "E-mail invalide")]
public string Email { get; set; }









share|improve this question






















  • It sounds like the browser is performing the autocomplete not the website/JavaScript
    – phuzi
    Nov 15 at 14:51










  • @phuzi maybe yes
    – mecabpazzo95
    Nov 15 at 14:55













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Hello i have a form with different input fields.



i want to know why only the suggestions ( autocomplete ) of the email input contain the email of my connection page and password saved by chrome.



i have try to delete the id="email" and the name="email" also the data annotations but suggestions appear also only for this input.



finally i want to disable this suggestion in this input i have tried also with autocomplete attribute but i have the same problem.



Here my code html :






<div class="col-6">
<label class="col-12 px-2 mdc-text-field">
@Html.TextBoxFor(model => model.Email, new { @class = "mdc-text-field__input", @style = "padding-left: 20px;" })
<span class="mdc-floating-label" style="padding-left: 20px;">Mail</span>
<div class="mdc-text-field__bottom-line"></div>
</label>
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</div>





Here my model :



 [Required(ErrorMessage = "L'adresse mail est obligatoire")]
[RegularExpression("^[a-zA-Z0-9_\.-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,100}$", ErrorMessage = "E-mail invalide")]
public string Email { get; set; }









share|improve this question













Hello i have a form with different input fields.



i want to know why only the suggestions ( autocomplete ) of the email input contain the email of my connection page and password saved by chrome.



i have try to delete the id="email" and the name="email" also the data annotations but suggestions appear also only for this input.



finally i want to disable this suggestion in this input i have tried also with autocomplete attribute but i have the same problem.



Here my code html :






<div class="col-6">
<label class="col-12 px-2 mdc-text-field">
@Html.TextBoxFor(model => model.Email, new { @class = "mdc-text-field__input", @style = "padding-left: 20px;" })
<span class="mdc-floating-label" style="padding-left: 20px;">Mail</span>
<div class="mdc-text-field__bottom-line"></div>
</label>
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</div>





Here my model :



 [Required(ErrorMessage = "L'adresse mail est obligatoire")]
[RegularExpression("^[a-zA-Z0-9_\.-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,100}$", ErrorMessage = "E-mail invalide")]
public string Email { get; set; }





<div class="col-6">
<label class="col-12 px-2 mdc-text-field">
@Html.TextBoxFor(model => model.Email, new { @class = "mdc-text-field__input", @style = "padding-left: 20px;" })
<span class="mdc-floating-label" style="padding-left: 20px;">Mail</span>
<div class="mdc-text-field__bottom-line"></div>
</label>
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</div>





<div class="col-6">
<label class="col-12 px-2 mdc-text-field">
@Html.TextBoxFor(model => model.Email, new { @class = "mdc-text-field__input", @style = "padding-left: 20px;" })
<span class="mdc-floating-label" style="padding-left: 20px;">Mail</span>
<div class="mdc-text-field__bottom-line"></div>
</label>
@Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
</div>






c# html asp.net-mvc






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 at 13:52









mecabpazzo95

246




246












  • It sounds like the browser is performing the autocomplete not the website/JavaScript
    – phuzi
    Nov 15 at 14:51










  • @phuzi maybe yes
    – mecabpazzo95
    Nov 15 at 14:55


















  • It sounds like the browser is performing the autocomplete not the website/JavaScript
    – phuzi
    Nov 15 at 14:51










  • @phuzi maybe yes
    – mecabpazzo95
    Nov 15 at 14:55
















It sounds like the browser is performing the autocomplete not the website/JavaScript
– phuzi
Nov 15 at 14:51




It sounds like the browser is performing the autocomplete not the website/JavaScript
– phuzi
Nov 15 at 14:51












@phuzi maybe yes
– mecabpazzo95
Nov 15 at 14:55




@phuzi maybe yes
– mecabpazzo95
Nov 15 at 14:55












1 Answer
1






active

oldest

votes

















up vote
2
down vote













So, here is what I understood from your question.



Your browsers suggests your stored email/password in the fields and want to avoid this.



Possible solution in a bare minimum code:



Key is to tell the browser not to suggest anything by turning the autocomplete off.



autocomplete="off"


You can set it in your form like this,



<form method="post" action="blah" autocomplete="off">
...
</form>


Or, you can set it directly to your field like this



<input type="text" id="lalaLand" name="ryan" autocomplete="off">


This should solve your problem. However, if it still doesn't work just give some garbage value in the autocomplete property instead of "off".



autocomplete="Katakomb"


I wouldn't recommend the last one since its a dirty workaround. Use it only if you run out of options.



Update 1:



From your comment I see disabling is not working for you. Try this one to see if it works. (Not able to post this in the comment due to the characters @ )



<%= Html.TextBoxFor(
model => model.Email,
new { @class = "mdc-text-field__input", @style = "padding-left: 20px;", autocomplete = "off" }
)%>


Update 2



A sample for handling through a custom attribute.



@Html.TextBoxFor(vm => vm.Blah, new { my_attribute= "myValue" })


This will generate a custom attribute in the actual HTML version as below



<input my-attribute="myValue" id="Blah" name="Blah" type="text" value="" />





share|improve this answer























  • thank you for answer but i wrote in my question i have tried with autocomplete attribute but dosn't work for me and the suggestion of stored email password appear just in the email input for this i want to change this condition for exemple why these suggestion dosn't appear in name input. look here stackoverflow.com/questions/53317764/…
    – mecabpazzo95
    Nov 15 at 14:18












  • You are welcome. I have added a small update to my answer. check it. If it doesn't work then may be it may have something to do with your browser settings.
    – Ebenezar John Paul
    Nov 15 at 14:28










  • i did that but also i have the same problem is there a solution to change the structure of the input field to avoid that chrome understand that is an email but in the same time we keep the the name="email" to send information to the server after filling the input fields
    – mecabpazzo95
    Nov 15 at 14:35










  • I understand. How about adding a custom property and send it to server?
    – Ebenezar John Paul
    Nov 15 at 14:45










  • okey but how i do that ? can you adding some code to your answer to more understand
    – mecabpazzo95
    Nov 15 at 14:51











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53320999%2fwhy-this-suggestion-is-only-in-the-email-input%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













So, here is what I understood from your question.



Your browsers suggests your stored email/password in the fields and want to avoid this.



Possible solution in a bare minimum code:



Key is to tell the browser not to suggest anything by turning the autocomplete off.



autocomplete="off"


You can set it in your form like this,



<form method="post" action="blah" autocomplete="off">
...
</form>


Or, you can set it directly to your field like this



<input type="text" id="lalaLand" name="ryan" autocomplete="off">


This should solve your problem. However, if it still doesn't work just give some garbage value in the autocomplete property instead of "off".



autocomplete="Katakomb"


I wouldn't recommend the last one since its a dirty workaround. Use it only if you run out of options.



Update 1:



From your comment I see disabling is not working for you. Try this one to see if it works. (Not able to post this in the comment due to the characters @ )



<%= Html.TextBoxFor(
model => model.Email,
new { @class = "mdc-text-field__input", @style = "padding-left: 20px;", autocomplete = "off" }
)%>


Update 2



A sample for handling through a custom attribute.



@Html.TextBoxFor(vm => vm.Blah, new { my_attribute= "myValue" })


This will generate a custom attribute in the actual HTML version as below



<input my-attribute="myValue" id="Blah" name="Blah" type="text" value="" />





share|improve this answer























  • thank you for answer but i wrote in my question i have tried with autocomplete attribute but dosn't work for me and the suggestion of stored email password appear just in the email input for this i want to change this condition for exemple why these suggestion dosn't appear in name input. look here stackoverflow.com/questions/53317764/…
    – mecabpazzo95
    Nov 15 at 14:18












  • You are welcome. I have added a small update to my answer. check it. If it doesn't work then may be it may have something to do with your browser settings.
    – Ebenezar John Paul
    Nov 15 at 14:28










  • i did that but also i have the same problem is there a solution to change the structure of the input field to avoid that chrome understand that is an email but in the same time we keep the the name="email" to send information to the server after filling the input fields
    – mecabpazzo95
    Nov 15 at 14:35










  • I understand. How about adding a custom property and send it to server?
    – Ebenezar John Paul
    Nov 15 at 14:45










  • okey but how i do that ? can you adding some code to your answer to more understand
    – mecabpazzo95
    Nov 15 at 14:51















up vote
2
down vote













So, here is what I understood from your question.



Your browsers suggests your stored email/password in the fields and want to avoid this.



Possible solution in a bare minimum code:



Key is to tell the browser not to suggest anything by turning the autocomplete off.



autocomplete="off"


You can set it in your form like this,



<form method="post" action="blah" autocomplete="off">
...
</form>


Or, you can set it directly to your field like this



<input type="text" id="lalaLand" name="ryan" autocomplete="off">


This should solve your problem. However, if it still doesn't work just give some garbage value in the autocomplete property instead of "off".



autocomplete="Katakomb"


I wouldn't recommend the last one since its a dirty workaround. Use it only if you run out of options.



Update 1:



From your comment I see disabling is not working for you. Try this one to see if it works. (Not able to post this in the comment due to the characters @ )



<%= Html.TextBoxFor(
model => model.Email,
new { @class = "mdc-text-field__input", @style = "padding-left: 20px;", autocomplete = "off" }
)%>


Update 2



A sample for handling through a custom attribute.



@Html.TextBoxFor(vm => vm.Blah, new { my_attribute= "myValue" })


This will generate a custom attribute in the actual HTML version as below



<input my-attribute="myValue" id="Blah" name="Blah" type="text" value="" />





share|improve this answer























  • thank you for answer but i wrote in my question i have tried with autocomplete attribute but dosn't work for me and the suggestion of stored email password appear just in the email input for this i want to change this condition for exemple why these suggestion dosn't appear in name input. look here stackoverflow.com/questions/53317764/…
    – mecabpazzo95
    Nov 15 at 14:18












  • You are welcome. I have added a small update to my answer. check it. If it doesn't work then may be it may have something to do with your browser settings.
    – Ebenezar John Paul
    Nov 15 at 14:28










  • i did that but also i have the same problem is there a solution to change the structure of the input field to avoid that chrome understand that is an email but in the same time we keep the the name="email" to send information to the server after filling the input fields
    – mecabpazzo95
    Nov 15 at 14:35










  • I understand. How about adding a custom property and send it to server?
    – Ebenezar John Paul
    Nov 15 at 14:45










  • okey but how i do that ? can you adding some code to your answer to more understand
    – mecabpazzo95
    Nov 15 at 14:51













up vote
2
down vote










up vote
2
down vote









So, here is what I understood from your question.



Your browsers suggests your stored email/password in the fields and want to avoid this.



Possible solution in a bare minimum code:



Key is to tell the browser not to suggest anything by turning the autocomplete off.



autocomplete="off"


You can set it in your form like this,



<form method="post" action="blah" autocomplete="off">
...
</form>


Or, you can set it directly to your field like this



<input type="text" id="lalaLand" name="ryan" autocomplete="off">


This should solve your problem. However, if it still doesn't work just give some garbage value in the autocomplete property instead of "off".



autocomplete="Katakomb"


I wouldn't recommend the last one since its a dirty workaround. Use it only if you run out of options.



Update 1:



From your comment I see disabling is not working for you. Try this one to see if it works. (Not able to post this in the comment due to the characters @ )



<%= Html.TextBoxFor(
model => model.Email,
new { @class = "mdc-text-field__input", @style = "padding-left: 20px;", autocomplete = "off" }
)%>


Update 2



A sample for handling through a custom attribute.



@Html.TextBoxFor(vm => vm.Blah, new { my_attribute= "myValue" })


This will generate a custom attribute in the actual HTML version as below



<input my-attribute="myValue" id="Blah" name="Blah" type="text" value="" />





share|improve this answer














So, here is what I understood from your question.



Your browsers suggests your stored email/password in the fields and want to avoid this.



Possible solution in a bare minimum code:



Key is to tell the browser not to suggest anything by turning the autocomplete off.



autocomplete="off"


You can set it in your form like this,



<form method="post" action="blah" autocomplete="off">
...
</form>


Or, you can set it directly to your field like this



<input type="text" id="lalaLand" name="ryan" autocomplete="off">


This should solve your problem. However, if it still doesn't work just give some garbage value in the autocomplete property instead of "off".



autocomplete="Katakomb"


I wouldn't recommend the last one since its a dirty workaround. Use it only if you run out of options.



Update 1:



From your comment I see disabling is not working for you. Try this one to see if it works. (Not able to post this in the comment due to the characters @ )



<%= Html.TextBoxFor(
model => model.Email,
new { @class = "mdc-text-field__input", @style = "padding-left: 20px;", autocomplete = "off" }
)%>


Update 2



A sample for handling through a custom attribute.



@Html.TextBoxFor(vm => vm.Blah, new { my_attribute= "myValue" })


This will generate a custom attribute in the actual HTML version as below



<input my-attribute="myValue" id="Blah" name="Blah" type="text" value="" />






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 15 at 15:01

























answered Nov 15 at 14:10









Ebenezar John Paul

83841537




83841537












  • thank you for answer but i wrote in my question i have tried with autocomplete attribute but dosn't work for me and the suggestion of stored email password appear just in the email input for this i want to change this condition for exemple why these suggestion dosn't appear in name input. look here stackoverflow.com/questions/53317764/…
    – mecabpazzo95
    Nov 15 at 14:18












  • You are welcome. I have added a small update to my answer. check it. If it doesn't work then may be it may have something to do with your browser settings.
    – Ebenezar John Paul
    Nov 15 at 14:28










  • i did that but also i have the same problem is there a solution to change the structure of the input field to avoid that chrome understand that is an email but in the same time we keep the the name="email" to send information to the server after filling the input fields
    – mecabpazzo95
    Nov 15 at 14:35










  • I understand. How about adding a custom property and send it to server?
    – Ebenezar John Paul
    Nov 15 at 14:45










  • okey but how i do that ? can you adding some code to your answer to more understand
    – mecabpazzo95
    Nov 15 at 14:51


















  • thank you for answer but i wrote in my question i have tried with autocomplete attribute but dosn't work for me and the suggestion of stored email password appear just in the email input for this i want to change this condition for exemple why these suggestion dosn't appear in name input. look here stackoverflow.com/questions/53317764/…
    – mecabpazzo95
    Nov 15 at 14:18












  • You are welcome. I have added a small update to my answer. check it. If it doesn't work then may be it may have something to do with your browser settings.
    – Ebenezar John Paul
    Nov 15 at 14:28










  • i did that but also i have the same problem is there a solution to change the structure of the input field to avoid that chrome understand that is an email but in the same time we keep the the name="email" to send information to the server after filling the input fields
    – mecabpazzo95
    Nov 15 at 14:35










  • I understand. How about adding a custom property and send it to server?
    – Ebenezar John Paul
    Nov 15 at 14:45










  • okey but how i do that ? can you adding some code to your answer to more understand
    – mecabpazzo95
    Nov 15 at 14:51
















thank you for answer but i wrote in my question i have tried with autocomplete attribute but dosn't work for me and the suggestion of stored email password appear just in the email input for this i want to change this condition for exemple why these suggestion dosn't appear in name input. look here stackoverflow.com/questions/53317764/…
– mecabpazzo95
Nov 15 at 14:18






thank you for answer but i wrote in my question i have tried with autocomplete attribute but dosn't work for me and the suggestion of stored email password appear just in the email input for this i want to change this condition for exemple why these suggestion dosn't appear in name input. look here stackoverflow.com/questions/53317764/…
– mecabpazzo95
Nov 15 at 14:18














You are welcome. I have added a small update to my answer. check it. If it doesn't work then may be it may have something to do with your browser settings.
– Ebenezar John Paul
Nov 15 at 14:28




You are welcome. I have added a small update to my answer. check it. If it doesn't work then may be it may have something to do with your browser settings.
– Ebenezar John Paul
Nov 15 at 14:28












i did that but also i have the same problem is there a solution to change the structure of the input field to avoid that chrome understand that is an email but in the same time we keep the the name="email" to send information to the server after filling the input fields
– mecabpazzo95
Nov 15 at 14:35




i did that but also i have the same problem is there a solution to change the structure of the input field to avoid that chrome understand that is an email but in the same time we keep the the name="email" to send information to the server after filling the input fields
– mecabpazzo95
Nov 15 at 14:35












I understand. How about adding a custom property and send it to server?
– Ebenezar John Paul
Nov 15 at 14:45




I understand. How about adding a custom property and send it to server?
– Ebenezar John Paul
Nov 15 at 14:45












okey but how i do that ? can you adding some code to your answer to more understand
– mecabpazzo95
Nov 15 at 14:51




okey but how i do that ? can you adding some code to your answer to more understand
– mecabpazzo95
Nov 15 at 14:51


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53320999%2fwhy-this-suggestion-is-only-in-the-email-input%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents