views:

114

answers:

2

My web page does not have the autocomplete attribute that would tell browsers not to autocomplete the field. In spite of not having this attribute, IE 8 or Safari (not sure on other browsers) does not autocomplete the page.

Autocomplete does work on some sites (such as Gmail) so I am assuming that the browser setting is not causing it?

Here's the code:

      <tr>
        <td>User Id</td>
        <td><input name="userId" type="text" id="userId" runat="server" /></td>
      </tr>
      <tr>
        <td>Password</td>
        <td><input name="password" type="password" id="password" enableviewstate="false" runat="server" /></td>
      </tr>
A: 

The autocomplete functionality is browser specific and it's behaviour can vary depending on whether the page was delivered over HTTPS and/or if caching is disabled using headers or meta tags. See http://msdn.microsoft.com/en-us/library/ms533486%28VS.85%29.aspx. The presence (or absence) of browser toolbars or addins can further complicate the issue.

As the web page developer you can only do so much to allow this behaviour, and specifying the name attribute and not specifying autocomplete=off is about as far as you can go.

AUSteve
A: 

Try changing
<input name="userId" type="text" id="userId" runat="server" />
to
<input name="username" type="text" id="userId" runat="server" />

Some browsers may not be detecting 'userId' as part of a login form.

Rowno