I have an application, where a normal login is present. Once login, user can create other users and we have forms with username and password fields present in those forms. Now my problem is, when login in the application and browser asks for remember password. If I say Yes and then I go to create other users then the forms show with the username password already filled that I used for login. I want to remember password for the main login form but don't want those to display when I am creating other users. This is mainly coming in chrome. Might come in other browsers on in mobile browser as well. I tried clearing the text box on document ready and setting autocomplete to off for the form. but didn't work out. If I remove the type="password" attribute from the password textbox, then the browser doesn't auto fill the username/password textbox but that causes the password to display. Any suggestion to overcome this issue are welcome.
2 Answers
use AutoComplete=off
The autocomplete attribute specifies whether or not an input field should have autocomplete enabled.
<input type="email" name="email" autocomplete="off">
Autocomplete allows the browser to predict the value. When a user starts to type in a field, the browser should display options to fill in the field, based on earlier typed values.
Note: The autocomplete attribute works with the following types: text, search, url, tel, email, password, datepickers, range, and color
.
Update
apparently chrome
ignores autocomplete="off"
This question will help you with that
Chrome Browser Ignoring AutoComplete=Off
Update 3
There is also another solution that works for people to and that is use autocomplete="false"
ref w3school

- 1
- 1

- 401
- 3
- 6
-
This would also disable the browser from remembering the main login which was a requirement of the OP – Mo09890 Jun 01 '16 at 10:57
-
@Mo09890 one question please do you want textbox to remember the password or not, if you want this keep it`on` if not then `off` you can't have both at the same time thats just not possible – KhawajaAtteeq Jun 01 '16 at 10:59
-
1I'm guessing that the OP is using two forms, one to log in and one to create new users, my suggestion was to use different ids in each form to trick the browser but you are right, setting one to `autocomplete="off"` is the right way to go. – Mo09890 Jun 01 '16 at 11:03
-
@KhawajaAtteeq I have tried autocomplete off on the textbox control and on the form also, but that's not working – user1542652 Jun 01 '16 at 11:19
-
@user1542652 There is something wrong with chrome, is it working properly in firefox? – KhawajaAtteeq Jun 01 '16 at 11:37
-
@user1542652 please see the update and I hope you'll find the solution their – KhawajaAtteeq Jun 01 '16 at 11:41
You can't tell the browser to only auto fill one set of usernames and passwords! Any sort of instructions to the browser regarding user names and passwords would be a security risk.
Your best bet would be to have the input controls have different ids and names so that the browser does not think this is the same form that it has saved information for.

- 174
- 1
- 9
-
-
-
@AhsanAzizAbbasi This will only stop asp.net from tracking the values you send down, it will not stop the browser from remembering the values. – Mo09890 Jun 01 '16 at 10:57
-