Kevin
Kevin

Reputation: 1465

Encrypting a textfield in 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?

Upvotes: 2

Views: 6419

Answers (5)

Sumit Ghulyani
Sumit Ghulyani

Reputation: 1

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.

Upvotes: 0

Glitch Desire
Glitch Desire

Reputation: 15023

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.

Upvotes: 1

rocklion
rocklion

Reputation: 1

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

Upvotes: 0

Tamil Selvan C
Tamil Selvan C

Reputation: 20209

Use <input type="password" />

Upvotes: 2

SLaks
SLaks

Reputation: 887469

You're looking for <input type="password" />.

Note that this has nothing to do with encryption.

Upvotes: 1

Related Questions