2

I want to mask a textbox in our application. But we can't use Textmod=Password because if we used Textmode=Password we can't retrieve the data in edit mode and we can't return the data to textbox affter saving. Here I want to make a textbox content as dots while typing and want to retrieve typed content as dots in that textbox. I just tried this code

-webkit-text-security: disc;-moz-text-security: disc;text-security: disc;

This code worked in Chrome but it doesn't work in either IE or Firefox.

How can i achieve the same results in IE and Firefox this?

frontendzzzguy
  • 3,242
  • 21
  • 31
  • possible duplicate of [-webkit-text-security compatibility](http://stackoverflow.com/questions/25822682/webkit-text-security-compatibility) – Mehmet Eren Yener Jun 26 '15 at 12:39
  • while you are editing, the data should be in dot format? – public FileResult Duser3230921 Jun 26 '15 at 12:53
  • @publicFileResultDuser3230921 ya i want data in dot format while editing also. here i used this " -webkit-text-security: disc;-moz-text-security: disc;text-security: disc; " but this worked in chrome. but not IE and firefox. I want to make this in IE and Firefox also. – salman rathore Jun 26 '15 at 12:55
  • @MehmetErenYener but how.?? – salman rathore Jun 26 '15 at 12:56
  • try something like this and handle remaining drawbacks [Jsfiddle](https://jsfiddle.net/w3hbrmnz/2/) – public FileResult Duser3230921 Jun 26 '15 at 13:32
  • @publicFileResultDuser3230921 we can't use jquery because its an old project. can you make it through javascript..?? my application is in asp .net(framework 2.0) . Can you please do it using javascript..??? – salman rathore Jun 26 '15 at 13:38
  • @salmanrathore - what advantage does this present over just using a an `input[type=password]` element? You most certainly can retrieve text from a password field in javascript, just as can you assign text to one. Here's a fiddle: http://jsfiddle.net/q7rL4dft/ – enhzflep Jun 26 '15 at 13:55

2 Answers2

0

I guess you are looking for this.You can change the text attribute after getting the values in text box.

Degrading -webkit-text-security

Community
  • 1
  • 1
0

Use This and you will get it.

<html>
<body>
<form method="post">
UserName
<input type="text" name="fname"/>
Password
<input type="password" name="lname"/>
</body>
</html>

This is what will come