Encrypting a textfield in HTML - html

I have a text field in my HTML project that I want to encrypt as a password.
So basicaslly instead of this being displayed in the text field:
mypassword
I want it to say:
*********
or something close to that.
So basically just making the text that the user inputs not to be visible.
How do I do this?

Use <input type="password" />

You're looking for <input type="password" />.
Note that this has nothing to do with encryption.

This has nothing to do with encryption, it's just a form field type, you can use the following:
<input type="password" name="password"/>
However, uploading whatever is entered in here when the user submits will send it plainly across the internet unless you're using HTTPS with a valid SSL certificate, which will encrypt all communications between the user and your site and is recommended for anything with a login.

You can use < input type="password" > like this to hide your password with stars.but it is not enough when you upload your password .you should use PHP or something else

Just put this in your existing code where you put your textbox
<input type="password" name="password"/>
This will not let you see what you enter and code it with stars, as default.

Related

Remembering email and password

I have the following problem. When I remember email and password on chrome email fills the latest email field on the page, but not the right one. Here is the image:
This happens on a register page also: but it shouldn't be here.
How could this be solved?
If you wish to prevent users from having inputs automatically filled out based on previously entered values which the browser stored, you can use the autocomplete="off" parameter on the input.
Eg. <input type="password" id="foo" autocomplete="off" ...>

How to check password while typing

i want to build a website and need to make a change password site. How can i check the password while typing?
See this example with the infobox at the right side.
I use Angular2 and want to do that with typescript.
Angular has built in capabilities to validate input. You could use a regular expression to validate the password:
<div>
<input placeholder="Enter your password" [(ngModel)]="password" #pwField="ngModel" type="password" pattern="[a-zA-Z]*[0-9]+[a-zA-Z]*">
</div>
<div *ngIf="!pwField.valid">Your password should contain at least one digit.</div>
Here's a start to what you're trying - http://www.w3schools.com/angular/tryit.asp?filename=try_ng_intro

autocomplete on form with two password fields

I'm having a problem with a form with two password fields. I have a form with three input fields: name (text), id (password), and PIN (password). My browser stores the password from PIN & autocompletes it back into the id field next time I visit the page. The PIN field is initialized empty.
Is there a way to have the ID number stored as the saved password & PIN left blank? I've tried adding an "autocomplete=off" attribute in the PIN input field with no effect.
FWIW, I'm using Firefox & trying not to use javascript.
Any suggestions (or documentation on how autocomplete/password saving actually works inside any browser) would be appreciated.
Kent
If autocomplete="off" is not working, you should add <input type="password" style="display: none;"/> before any password input. It will hold completed password and will not interfere with anything.
<input name="password" type="password" autocomplete="off"> should do it in firefox.
See this answer: Is autocomplete="off" compatible with all modern browsers?
Did you put the off in quotes?

Weird input text and input password erasing default input password

I have a simple text and password input with default username and password filled out. If I put focus on the text input and then remove the focus, it erases my password input for some reason. This only seems to happen on firefox. I thought it would be my surrounding code, but I tried moving everything to a blank page and stripped everything to the bare bones with no luck:
<form>
<input type="text" value="username" />
<input type="password" value="password" />
</form>
A few things I noticed were it doesn't matter what value I change the username and password to, I still get this problem. If I remove the opening form tag, this problem disappears. If I swap it around and put the password first then followed by the username, it will work... Another weird thing is if I run this file from my operating system path the problem also disappears. Anyone have any idea what could be the problem?
Sounds like Firefox's form field auto-completion is getting in your way. You can disable it by adding autocomplete="off" to the <input> fields or to the <form> element to disable it for all fields.
It seems like it is Firefox(at least 3.5.1) Password manager behavior. On blur it looks for very next input field in DOM tree and if there is a password field then manager replaces current value with one what was stored before or with empty string if no matches found.
To ensure it you can try to enter stored for this page/domain user name into input and remove focus. FF will substitute stored password.
As a workaround you can insert <input id="dummy" type="text" style="display:none;" /> between text and pass fields. This will break common markup pattern on which FF relies.

How do I suppress firefox password field completion?

I'm developing a website. I'm using a single-page web-app style, so all of the different parts of the site are AJAX'd into index.php. When a user logs in and tells Firefox to remember his username and password, all input boxes on the site get auto-filled with that username and password. This is a problem on the form to change a password. How can i prevent Firefox from automatically filling out these fields? I already tried giving them different names and ids.
Edit: Someone has already asked this. Thanks Joel Coohorn.
From Mozilla's documentation
<form name="form1" id="form1" method="post" autocomplete="off"
action="http://www.example.com/form.cgi">
[...]
</form>
http://developer.mozilla.org/en/How_to_Turn_Off_Form_Autocompletion
The autocomplete="off" method doesn't work for me. I realized firefox was injecting the saved password in the first password field it encountered, so the solution that worked for me was to create a dummy password field before the password update field and hide it. Like so:
<input type="password" style="display: none;" />
<input type="password" name="password_update" />
Have you tried adding the autocomplete="off" attribute in the input tag? Not sure if it'll work, but it is worth a try.
are all your input boxes set to type=password? That would do it. One of the things you can do, and I'm not at all sure that this is the best answer is to leave input box as an input type and just use javascript and onkeydown event to place stars in the input box instead of having the browser render it. Firefox won't pre-fill that.
As an aside, I have had to work on single-page web-apps and I absolutely hate it. Why would you want to take away the user's ability to bookmark pages? To use the back button?
Adding to this answer https://stackoverflow.com/a/30897967/1333247
This is in case you also have a User field in front of the password fields and want to disable autocompletion for it too (e.g. router web config, setting proxy User and Password).
Just create a dummy user field in front of the dummy password field to hide user name autocompletion:
<input type="text" style="display: none;" />
<input type="password" style="display: none;" />
<input type="password" name="password_update" />
Per the docs this is about the Login autocompletion. To disable the normal one (e.g. search terms completion), just use the
autocomplete="off"
attribute on the form or inputs. To disable both you need both, since the attribute won't disable Login autocompletion.