views:

1525

answers:

6

Hi there,

I've created a login submit form in HTML but for some reason autocompletion does not work 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 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. Notice that I don't (want to) use cookies.

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">&nbsp;</div>
        <div class="login_line_right"><input class="button" value="login" type="submit"></div>
    </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.

Update I'm using php and FF3

Thanks, Jasper

+1  A: 

Does your login URL include a session ID that changes each time?

John Topley
+1  A: 

Have you checked your saved passwords list to see if you have already told Firefox to never remember credentials for your site?

Ross
A: 

Firefox prompts me if I would like to remember the password. I press 'remember' and login works. - I log out and return to the login page. I would expect the username and password field to be prefilled

That's not the way Firefox works. You have to put the username in, and it will remember the password for that username.

AmbroseChapel
A: 

Thanks for your answers.

John: My login URL does not include a session ID.

Ross: I have checked. I made sure I deleted all remembered passwords. After login I can see that FF has saved my username password combination.

Ambrose: I think that if FF has stored only one user/pw combi for a specific URL than it automatically prefills this combi in your form. The behaviour your describing applies when several user/pw combinations have been saved for the same URL.

I still don't understand why my html code doesn't work in FF.

A: 

I pasted your HTML into an empty HTML document, removed the onsubmit="" javascript code, typed in a username and password and hit submit, got prompted to save the password, and the next time I hit reload - FF3 autofilled both fields.

WorksForMe(tm).

I wonder if removing the onsubmit="" code changes anything for you...?

Also a link to a running example would be helpful.

Már Örlygsson
A: 

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.

jasperdejong