0

I've got a form with a textbox on it. I have had to apply an input mask on the field as per client's requirements. Client now wants to obscure the input in the manner of a password input field. I've tried setting it as password input but the mask stops working, Is this possible or should I give up now?

immutabl
  • 6,857
  • 13
  • 45
  • 76
  • you can fake one with onkeyup to replace whatever was typed with `*`, and store the previously entered text elsewhere. – Marc B Oct 18 '16 at 17:15
  • Yes it is possible but your question doesn't make any sense.. – tcooc Oct 18 '16 at 17:17
  • Try checking out the answer to this question http://stackoverflow.com/questions/25367230/masking-a-social-security-number-input you should be able to refactor that for your purposes. – jeanpier_re Oct 18 '16 at 18:07

1 Answers1

4

I found this: https://css-tricks.com/snippets/css/password-input-bullet-alternatives/

Which leads to this example: http://jsfiddle.net/estelle/8WpNg/ using the -webkit-text-security property

Seems to work in Chrome, but not Firefox. Searching a bit further I found this article that seems to discuss a JavaScript solution to making this degrade gracefully across browsers that do not support this feature with CSS: Degrading -webkit-text-security

Community
  • 1
  • 1
Phil Gibbins
  • 492
  • 5
  • 13
  • Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Heretic Monkey Oct 18 '16 at 18:10
  • Thanks for that @MikeMcCaughan, it's my first time answering on SO, will endeavour to do better in future. That's a fair point raised – Phil Gibbins Oct 18 '16 at 19:28
  • Thanks @PhilGibbins. unfortunately I need a fully cross-browser solution so although this works perfectly on webkit based browsers it doesn't on IE which unfortunately I'm still writing for. – immutabl Oct 19 '16 at 09:53