Solved

make user type only lowercase in textbox

Posted on 2013-06-01
4
513 Views
Last Modified: 2013-06-02
The normal procedure for an textbox is let the use type whatever they want, so the user can type all text uppercase.

I just don~t want that, i want to let the user type only the first character of each word uppercase, but that~s if he types uppercase.

example:

user typed      =   result
I LOVE TO EAT = I Love To Eat
I love to eat    = I love to eat
I Love to eat   = I Love to eat

so the first character is always uppercase, but the rest of the words  is lowercase if the user don~t type uppercase, but it he does type only the first character is uppercase.

I want to do this in javascript so the change will be visible while he is typing.
0
Comment
Question by:rafaelrgl
4 Comments
 
LVL 40
ID: 39213953
You need to be sure that you really want to implement that feature. It would prevent the user from being able to write "John and Mary love to eat" or "Can you tell me what I love to eat?"
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39214191
0
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 39214328
change will be visible while he is typing.

This will leave the first character of any word the way it was typed (upper or lower case) but change all other characters to lowercase as the user is typing. A phrase like "JoHn and Mary LOVE TO EAT" will become "John and Mary Love To Eat". It will not however correct mistakes. So if "Can you tell me what I love to eat?" is typed in all lower case, it will remain all lower case.

http://jsfiddle.net/cFWFW/
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39214348
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question