First letter MUST be uppercase

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Germaris
    New Member
    • Jan 2008
    • 18

    First letter MUST be uppercase

    Hi there!

    Nowadays trend is to write everything in lowercase. Last Names, First Names, City Names, etc...
    Maybe the use of computers is one of the reasons to such bad typing.

    In a form, there's a lot of Input Fields to fill-in...
    Is there a way in AS to make the first letter typed in an uppercase one?

    I thank you in advance for the help you'll provide.

    Best regards,
    Gerry
  • nomad
    Recognized Expert Contributor
    • Mar 2007
    • 664

    #2
    Originally posted by Germaris
    Hi there!

    Nowadays trend is to write everything in lowercase. Last Names, First Names, City Names, etc...
    Maybe the use of computers is one of the reasons to such bad typing.

    In a form, there's a lot of Input Fields to fill-in...
    Is there a way in AS to make the first letter typed in an uppercase one?

    I thank you in advance for the help you'll provide.

    Best regards,
    Gerry

    hello Gerry:
    you could do something like this

    Heres the code for the method:

    Code:
    String.prototype.ucFirst=function()
    {
    if(arguments[0] == true)
    {
    var words=this.split(" ")
    for(var w in words)
    {
    words[w]=words[w].ucFirst()
    }
    return words.join(" ")
    }
    return this.charAt(0).toUpperCase()+this.substring(1,this.length)
    }

    Code:
    input_title="this is my title";
    title=input_title.ucFirst();
    input_name="guy watson";
    name=input_name.ucFirst(true);
    nomad

    Comment

    Working...