Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-06-2009, 07:12 PM   PM User | #1
Bogies girl
New to the CF scene

 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Bogies girl is an unknown quantity at this point
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;

}
Bogies girl is offline   Reply With Quote
Old 12-07-2009, 11:04 AM   PM User | #2
ww.yashika.info
New to the CF scene

 
Join Date: Dec 2009
Location: Battaramulla
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ww.yashika.info is an unknown quantity at this point
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>
ww.yashika.info is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:37 PM.


Advertisement
Log in to turn off these ads.