Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with code

    Ok I have look all over and cannot find out how to do this. I have found how to covert first letter of a word to capitalization, but not just the LAST letter. Such as bogieS. Is this not at all possible? Am I driving myself insane for no reason? This is what I have and it isn't near right.


    function capitalizeMe(obj) {
    val = obj.value;
    newVal = '';
    val = val.split(' ');
    for(var c=0; c < val.length; c++) {
    newVal += val[c].substring(0,1).toLowerCase(0,-1) +
    val[c].substring(0,val[c].length) + ' ';
    newVal += val[c].substring().toUpperCase(0) +
    val[c].substring(0,val[c].length) + ' ';

    }
    obj.value = newVal;

    }

  • #2
    New to the CF scene
    Join Date
    Dec 2009
    Location
    Battaramulla
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Re

    Pls check whether the following satisfies your need...

    <script language="JavaScript">
    function makeMeUpper(myname)
    {
    var name_len = myname.length;

    var last_char =myname.charAt(name_len-1);
    last_char =last_char.toUpperCase();

    myname = myname.substring(0,name_len-1);
    myname = myname+last_char;
    return myname;
    }

    alert(makeMeUpper('Hello'));

    </script>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •