Skip to content

Instantly share code, notes, and snippets.

@kwhinnery
Created December 4, 2009 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kwhinnery/249080 to your computer and use it in GitHub Desktop.
Save kwhinnery/249080 to your computer and use it in GitHub Desktop.
var ta1 = Titanium.UI.createTextArea({
id:'idOfADOMElement',
value: 'Here\'s a new #tweet @joeschmoe',
keyboardType:Titanium.UI.KEYBOARD_ASCII,
autocorrect:false,
textAlign:'left',
height:100,
width:255
});
//recalculate on every change
ta1.addEventListener("change", function(e) {
var text = e.value;
var tweetLimitStatus = 140 - text.length;
// tweetLimitStatus is now how many characters remaining in a tweet, can be negative
// if the tweet were too long
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment