Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Automaticaly capitalising text using Javascript

 
Ronan Dowd
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a form with an input textfield, called "name". I would like for a user to type into this field his name and for Javascript to automatically capitalize the first letter of his input (once the user tabs or clicks off the textfield)

Would anyone any code samples/links where I could get some javascript to do this.

Thanks in advance - Ro.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
basic idea:



Eric
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh and

onblur="this.value=this.value.firtstLetterToCap()"

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic