Archive

Archive for March, 2008

Making the first letter in a textfield Uppercase

March 19th, 2008 No comments
  1. var myKeyListener = new Object();
  2. myKeyListener.onKeyUp = function() {
  3. var myString = myTextfield.text;
  4. var firstLetter = (myString.charAt(0)).toUpperCase();
  5. var remainderLetters = (myString.substring(1)).toLowerCase();
  6. var myNewString = firstLetter+remainderLetters;
  7. myTextfield.text = myNewString;
  8. };
  9. Key.addListener(myKeyListener);
SEO Powered by Platinum SEO from Techblissonline