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; }
c# html asp.net-mvc
add a comment |
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; }
c# html asp.net-mvc
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
add a comment |
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; }
c# html asp.net-mvc
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
c# html asp.net-mvc
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
add a comment |
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
add a comment |
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="" />
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
|
show 6 more comments
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="" />
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
|
show 6 more comments
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="" />
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
|
show 6 more comments
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="" />
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="" />
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
|
show 6 more comments
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
|
show 6 more comments
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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