freelance84 Posted October 19, 2010 Share Posted October 19, 2010 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 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? Quote Link to comment Share on other sites More sharing options...
freelance84 Posted October 19, 2010 Author Share Posted October 19, 2010 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.