How to get Chrome to remember login on forms? - google-chrome

On many websites when you login via Chrome it will offer to remember your login details.
I have a login form and this does not happen.
Here's the form:
<form action="/login" method="post">
<label for="username">Email Address:</label>
<input id="username" name="username" autofocus="autofocus" required="required" type="email" size="25" autocomplete="off"/>
<label for="password">Password:</label>
<input id="password" name="password" required="required" type="password" size="25" autocomplete="off"/>
<input type="submit" value="Login">
</form>
I'm assuming there must be some variable or header that needs setting to do this.
Does anyone know how its done?

I removed the autocomplete parameters from the form and now Chrome can store username and password here.

Related

How to get browser to ignore password fields on a "change my password" form?

I have a web app (JSP, Spring, Tomcat) and after the user is logged in, they can click a "Change Password" link which prompts them with a simple form with "Password" and "Confirm Password" fields.
<div class="form-group">
<label class="control-label col-sm-2">New Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="password" id="password" placeholder="Password" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Confirm New Password:</label>
<div class="col-sm-10">
<input type="password" class="form-control" name="confirmPassword" id="confirmPassword" placeholder="Confirm Password" required>
</div>
</div>
Works fine, except the browser thinks this is a login form and prompts the user if they want to save the password in the browser.
My understanding is autocomplete="off" was intended to prevent the prompting, but modern browsers ignore that field.
Alternately, is there some way to use type="text" and still have the characters displayed as masked bullet characters?
The valid options for autocomplete are on and off, not true/false.
In new versions of Chrome the way you described does not work. Try this:
<input type="password" name="password" autocomplete="user-password">

Browser save password show in wrong input

This is login form
<form method="post">
<input name="username" type="text" />
<input name="password" type="password" />
</form>
After login and save password by Browser, i go to users manage page
<form method="post">
<input name="email" type="text" />
<input name="name" type="text" />
<input name="password" type="password" />
</form>
This page, browser show password and username by default to name and password
How fix it ?
https://i.stack.imgur.com/uniJY.jpg
https://i.stack.imgur.com/7ZbTJ.jpg
Use different names in input tag
How do you disable browser Autocomplete on web form field / input tag?
Used autocomplete attribute of tag.
read this link:https://www.w3schools.com/tags/att_form_autocomplete.asp
Autocomplete. autocomplete="off|on".
"When autocomplete is on, the browser automatically complete values based on values that the user has entered before." link
<form method="post" autocomplete="on">
<input name="email" type="text" />
<input name="name" type="text" />
<input name="psw" type="password" />
</form>
You shouls also use different input names.

New to coding. Having trouble with an email form on my portfolio webpage

I'm trying to make a form that will send a person's details to me in an email. I've been successful in getting the page to start a new email to the selected email address, but the input values from the form are not populating in the email. It's just empty.
Here is my code:
<form role="form" action="MAILTO: myemail#gmail.com">
<input type="text" placeholder="Name" id="name">
<br><br>
<input type="text" placeholder="Phone" id="phone">
<br><br>
<input type="email" placeholder="Email" id="email">
<br><br>
<button type="submit">Submit</button>
</form>
I've googled this and asked for help on the forums for the program I'm using to learn, but no success. Any help appreciated. Thanks!
Your code is right, but you were missing 2 things. 1 the method of the form, in this case method="post" and the inputs need a name not an id. Code is corrected below:
<form role="form" action="MAILTO: myemail#gmail.com" method="post" enctype="text/plain">
<input type="text" placeholder="Name" name="name">
<br><br>
<input type="text" placeholder="Phone" name="phone">
<br><br>
<input type="email" placeholder="Email" name="email">
<br><br>
<button type="submit">Submit</button>
</form>
Also to make the email better formatted I have added an enctype.

Unable to use mouse on text fields, have to use tab

I've had this weird situation just popup where I'm unable to use my mouse on a form I'm creating. It's requiring me to tab through the text fields. if I click on the second field it just pushes me back to the first field, i have to tab!
this is the form totally simple, it has something to do with the labels but I have never had issues before.
BTW: no JS or CSS in this form or page
my example:
<form>
<label for="username"*Username label>
<input type="text" name="username" tabindex="1" id="username">
<label for="password"*Password*label*>
<input type="password" name="password" tabindex="2" id="password">
<input type="submit" class="button" value="Login" name="submit" >
</form>
This is the proper way to format inputs with labels. This should fix your problem.
<label for="username">*Username*<input type="text" name="username" tabindex="1" id="username"/></label>
<label for="password">*Password*<input type="password" name="password" tabindex="2" id="password"/></label>
demo: http://jsfiddle.net/ZFZgt/

No 'Save Password' Prompt by any browser for my form

My form is attached below, and I have tried many things I've found in other forums, but to no avail. I cant get the browser to prompt a 'Save Password'. Where am I going wrong. Hope someone can help. Thanks.
<form id="frmlogin" action="/index" method="post" enctype="application/x-www-form-urlencoded" autocomplete="on">
<label id="landing_username" class="required" for="username">Username/Email</label>
<input id="landing_username" name="username" type="text" value="" name="username" />
<label id="landing_password" class="required" for="password">Password</label>
<input id="landing_password" name="password" type="password" value="" name="password" />
<submit id="loginbtn" onclick="LoginFun()" type="submit" name="loginbtn">Login</submit>
</form>
Try to clean the HTML a bit, maybe it helps:
<form id="frmlogin" action="/index" method="post">
<label id="landing_username" class="required" for="username">Username/Email</label>
<input id="username" name="username" type="text" />
<label id="landing_password" class="required" for="password">Password</label>
<input id="password" name="password" type="password" />
<input id="loginbtn" onclick="LoginFun()" type="submit" name="loginbtn" value="Login" />
</form>
the form attribute enctype is by default application/x-www-form-urlencoded so you don't need to specify it
the labels for attribute should contain the id, not the name of the associated input
element IDs should be unique
the attribute name is defined twice for both password and username
the attribute autocomplete is by default on
the input value is not required, so you don't need to add it to the inputs with an empty string
the submit button should be an input of type submit
Some of these changes are only optimizations and the code could work fine without them, but others, such as ensuring the unique id of each tag, are fixes and they are strongly recommended even if the browser displays the form properly.