JavaScript

Moderators: None (Apply to moderate this forum)
Number of threads: 2061
Number of posts: 5164

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Mask a text field Posted by gonzilla on 29 Jul 2003 at 4:53 AM
Hi,

How do you similate a password field in a input text box field without using type="password"? For instance, what if I wanted to mask it with a "-" instead of a "*"?

I have it kind of working but I don't know if this is the best way to do it or if there was a more robust way.

function toDash (evt) {
   var keyCode = evt.keyCode ? evt.keyCode : evt.charCode ? evt.charCode : evt.which ? evt.which : void 0;
   if (keyCode) {
       window.event.keyCode = "-".charCodeAt();
       return true;
    }
	return false;
}


Thanks.

-Tyler



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.