sg552
sg552

Reputation: 1543

Styling or override input text with password mask

Let's say I have this

Name : <input type="text" name="name" />

I want to mask the user input with password sign either like asterix or dot. Is it possible to do this?

Yes, I know I could do Password : <input type="password" /> but I want to do with input type="text" . Is it possible?

Thank you

Upvotes: 0

Views: 1145

Answers (4)

user2393867
user2393867

Reputation:

if you don't want to use input type="password".use javascript keyup function and make a custom replace function

Upvotes: 0

Mr. Alien
Mr. Alien

Reputation: 157334

I don't know why you want to do this as we have type="password" but still if you want to hide the fields which have type="text" than you can use this (Only webkit)

input[type="text"] {
  -webkit-text-security: disc;
}

Demo (Webkit Only)

Upvotes: 2

Maxim Kumpan
Maxim Kumpan

Reputation: 2625

You should be using

<input type="password"/>

Upvotes: 0

Babar Al-Amin
Babar Al-Amin

Reputation: 3984

Just change the type to password.

Name : <input type="password" name="name" />

Upvotes: 0

Related Questions