-1

I'm making a login form, but I don't want browser to be able to save username & password combination.

Just like PayPal or banks.

I have heard that I could do this by using AJAX & Javascript but I'm so unfamiliar with them, so I need to ask help from you!

<form id="loginform">
<label for="username">Username</label>
<input name="username" type="text" value="" required="required" />
<label for="password">Password</label>
<input name="password" type="password" value="" required="required" />
<input type="button" name="doLogin" value="Login" onclick="login(this.form.username.value,this.form.password.value);" />`

With that login form the browser doesn't ask to save the login combo... but now I just need to know how to send the login info to PHP :P

Jussi Hietanen
  • 171
  • 1
  • 11
  • http://stackoverflow.com/questions/32369/disable-browser-save-password-functionality – Pavel Strakhov May 03 '12 at 16:16
  • 1
    The browser does not "save" anything by itself, unless some user/setting is enabled - & if it does, that would be one heck of an interesting browser! – Sunny May 03 '12 at 16:16
  • "I don't want browser to be able to save username & password combination." please read – Jussi Hietanen May 03 '12 at 16:17
  • Please see the link provided by @Riateche which talks about the solution you are looking for. Still, like I said - the browser does not "save" anything by itself - unless there is some action/setting at the client to do so. What you are interested in finding out is - can you, as a developer, override the browser capability to allow the user to store username/password. – Sunny May 03 '12 at 16:21

2 Answers2

0

I am assuming that you require the prevention of things like autoformer (for Firefox). Simply change the names of the various input values to something that is different each time the user loads the form.

Ed Heal
  • 55,822
  • 16
  • 77
  • 115
0

As Sunny's link suggest, you can use the autocomplete attribute to prevent the browser from suggesting input for a field. So for your example:

<form id="loginform">
   <label for="username">Username</label>
   <input name="username" type="text" value="" required="required" autocomplete="off"/>
   <label for="password">Password</label>
   <input name="password" type="password" value="" required="required" autocomplete="off" />
   <input type="button" name="doLogin" value="Login" onclick="login(this.form.username.value,this.form.password.value);" />
Trent
  • 1
  • 1