iPhone-Style Password Inputs with Appcelerator Titanium

By  on  
iPhone Password Mask

Most mobile applications ask you for your credential so that they may verify your account and pull information via an API.  My mobile application is no different.  The problem I ran into was that I couldn't find the method by which to emulate the iPhone's password field behavior.  Luckily a quick search gave me the answer:

// Create the text field
var formElement = Titanium.UI.createTextField({
	value: "",
	width: 100,
	height: "auto",
	hintText: "Password",
	passwordMask: true
});

Setting the passwordMask property to true provides the true iPhone-style password masking that I desired.  Now all but the last letter in the password are properly hidden!

Recent Features

  • By
    5 HTML5 APIs You Didn’t Know Existed

    When you say or read "HTML5", you half expect exotic dancers and unicorns to walk into the room to the tune of "I'm Sexy and I Know It."  Can you blame us though?  We watched the fundamental APIs stagnate for so long that a basic feature...

  • By
    Facebook Open Graph META Tags

    It's no secret that Facebook has become a major traffic driver for all types of websites.  Nowadays even large corporations steer consumers toward their Facebook pages instead of the corporate websites directly.  And of course there are Facebook "Like" and "Recommend" widgets on every website.  One...

Incredible Demos

  • By
    jQuery UI DatePicker:  Disable Specified Days

    One project I'm currently working on requires jQuery. The project also features a datepicker for requesting a visit to their location. jQuery UI's DatePicker plugin was the natural choice and it does a really nice job. One challenge I encountered was the...

  • By
    Smooth Scrolling with MooTools Fx.SmoothScroll

    I get quite a few support requests for my previous MooTools SmoothScroll article and the issue usually boils down to the fact that SmoothScroll has become Fx.SmoothScroll. Here's a simple usage of Fx.SmoothScroll. The HTML The only HTML requirement for Fx.SmoothScroll is that all named...

Discussion

  1. Good, that was what I search and arrive here ;)

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!