0

I have an input field which currently looks like this: enter image description here

I would prefer the value to be hidden like this:

enter image description here

Here is the kicker, I know that giving the field a type=password will do this, but unfortunately the software I am using brings over 2 password fields in this case. So, I am left with a standard text input to create the effect.

My hope is that there is some CSS styling that I can do to the field id in order to hide the input information. Thanks for you attention to this issue.

2 Answers 2

0

You could just use:

input { -webkit-text-security: disc; /* Default */ }

as described here

Here is also a dirty hack for other browsers

Sign up to request clarification or add additional context in comments.

4 Comments

.... for webkit only? Lol, don't use this. I don't even think its supported any more. Tested in IE 10 doesn't work. DEMO
this is the type of fix I am after, but yes I need something that is supported across more browsers than just chrome.
@Presto I already said it doesn't work in IE and lets face it, a ton of people using IE so don't use it. Also no, it doesn't work in FF
@Ruddy thanks. in that case it won't work for me. No IE is fine, but FF is needed.
0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="txt/javascript">
<script type="text/javascript">
    function replaceT(obj){
        var newO=document.createElement('input');
        newO.setAttribute('type','password');
        newO.setAttribute('name',obj.getAttribute('name'));
        obj.parentNode.replaceChild(newO,obj);
        newO.focus();
    }
</script>
</head>
<body>
      <form>
          <input type="text" name="password"  onfocus="replaceT(this)">
      </form>
</body>
</html>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.