Jump to content

browser putting username in wrong fields


freelance84

Recommended Posts

I have come accross a problem on my site. If i let the browser (FF in this example) remember my login details, it then places them in some input fields on my account settings page. Only it puts them into the wrong one.

Eg, it places the username from the login into the  "new_forename" field in the account settings :confused:

 

below is the html (minus the divs...etc) for the site login form and then the change forename form on account settings.php.

 

 

Here is the html code for the username and password entry on my login screen:

 
<form name="login" method="post" action="authenticate.php">
username
<input style="width:180px" name="enter_user" type="text"/>
<span class="form-warning"></span>

password
<input  style="width:180px" type="password" name="enter_pass"/>
<input class="button blue medium" type="submit" name="login" value="login"/>
</form>

 

Here is some html code from my account settings page

<form name="new_forename" method="post" action="accountDetails.php">
Enter new forename <input type="text" name="new_forename" value="" size="30"/><br/>
Enter your password <input type="password" name="password" size="30"/>

<input class="button blue medium" style="width:130px" type="submit" name="save_forename" value="Save new forename"/>
<input class="button red medium" type="submit" name="cancel" value="Cancel"/>
</form>

 

How can i correct this?

 

Is it that the browser is seeing the "password" fields and simply filling in the stored password field with the password saved for the site?

Link to comment
Share on other sites

Ok after much searching i haven't found anything on the issue.

 

But i think i have figured out what is going on:

 

1 If i enter my login details into the index, the browser asks if i want to remember my details.

 

2 I click yes

 

3 I then continue to use the site.

 

4 When i go to the account settings page, i can change my personal details, like the email adress registered, forename surname and username... etc. However when i created this page, i felt that some of these changes could only occur if the user inputted their password first (to try and prevent someone else coming along and changing them).

 

5 Each section of the account settings is an individual form. Like changing the username. And each one of these individual forms required the users password entering.

 

6 With the browser remembering passwords, as soon as it sees a password field it automatically filled in the password stored and the field above it assumes is the login so also fills that in with the username.

 

7 I have now noticed that when i use one of these forms, eg the forename change, the autofill puts the username in where the form is asking for the new forename. However when i enter a new forename and passwords and hit submit, the forename is changed, but when the form is reloaded the browser can no longer autofill the fileds as there is more than one option.

 

 

----I don't know if this is really what is happening, but it's the only explanation i can come up with.

 

----with my very limited knowledge in javascript, i tried to wipe these fields onfocus but failed

 

 

-----would anyone agree or disagree with my theory?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.