Hi,
I've created a login submit form in HTML but for some reason user/password autocompletion does not work like I expect in firefox.
This is what happens in Firefox:
- I give username and password and click on the login button
- Firefox prompts me if I would like to remember the password. I press 'remember' and login works. (I made sure I deleted all remembered passwords before running this test)
- I log out and return to the login page. I would expect the username and password field to be prefilled but that is not the case (if FF has stored only one user/pw combi for a specific URL than it automatically prefills this combi in your form)
Notice that I don't (want to) use cookies. I verified in FF password manager that username and password had actually been stored (they were)
Here's the code for this page:
<form name="login_form" id="login_form" autocomplete="ON" onsubmit="javascript:xajax_action_login(document.getElementById('user_name').value, document.getElementById('password').value); return false;">
<div class="login_line">
<div class="login_line_left">name</div>
<div id="user_name_id" class="login_line_right"><input size="16" maxlength="16" name="user_name" id="user_name" type="text"></div>
</div> <!-- login_line -->
<div class="login_line">
<div class="login_line_left">password</div>
<div id="password_id" class="login_line_right"><input size="16" maxlength="16" name="password" id="password" type="password"></div>
</div> <!-- login_line -->
<div class="login_line">
<div class="login_line_left"> </div>
<div class="login_line_right"><input class="button" value="login" type="submit">
</div> <!-- login_line -->
</form> <!-- login_form -->
What is wrong with my code? How can I get autocompletion to work in FF with my code?
Autocompletion does work correct with for instance gmail. Each time I visit the login page of gmail, the email and password fields are correctly prefilled. I don't use the 'remember me on this computer' checkbox so no cookies are used.
I would greatly appriciate your help. Jasper
Update Autocomplete is enabled in firefox. I want to stay IE compatible.
-
Are the urls static or dynamic, auto completion doesn't work with dynamic urls, say your url is:
http://www.domain.come/login.php?someDynamicVarLikeAdateOrSo=12312
Then password saving won't work, you should then use modrewrite or something to display the url as static to the browser
-
URL is static.
-
First, check to see if autocomplete is enabled in firefox.
Then try setting the 'type' attribute of the text box to be 'autocomplete'. Details are given here -
Autocomplete is enabled in firefox
textbox is an non html element. I want to stay IE compatible.
majelbstoat : Please add these additional points to the main question. -
It looks like you have
autocomplete="ON"
in the<form>
tag. Try changing that toautocomplete="on"
-- that is, remove the capitalization of 'ON'.jasperdejong : Hi genehack, tried it and it didn't fix my problem. Thanks for your suggestion. -
I found out why it doesn't work. I use ajax to paste the example html in a container div. Apperently firefox is very sensitive about this because (as mentioned before) my code does work in IE.
-
This thread is an exact duplicate of Autocomplete for password doesn't work.
0 comments:
Post a Comment