tags:

views:

46

answers:

2

I'm currently trying to capitalize the very first letter from an input.

Here's what I tryed :

fieldset input
{
    text-transform:capitalize;
}

But it doesn't work the way I want, as every word is capitalized.

I also tryed this :

fieldset input:first-letter
{
  text-transform:uppercase;
}

But it seems <input /> doesn't work at all with first-letter...

Anyway, do you have any idea of how to achieve this without javascript (or as little as possible) ?

A: 

Impossible. It is possible with Javascript, or by putting only the first word within a span.

Sjoerd
You can't have `span` elements in an input text field.
Deniz Dogan
+4  A: 

JS: str.charAt(0).toUpperCase();

Babiker
Thanks, I'll try this with a jQuery selector, then.
Safirio
@Safirio, should work.
Babiker