Re: input type alpha

2013-01-16 16:10, Fred  wrote:

> The input element has a type attribute which allows values such as 
> number, text, etc.
>
> Number matches only digits.
> Text matches *everything*.
>
> It would be nice with 'alphabetic' that matches only a-z, not 
> !@#$%/[]{}(), etc.

Using <input type=number> is expected to be implemented so that the user 
can input a number via some user interface, and the set of allowed 
values depends on other attributes of the element, and may allow numbers 
with a decimal part or with a sign.

To specify that a-z only be accepted, you can use <input type=text 
pattern="[a-z]"> or (if uppercase is to be allowed too) <input type=text 
pattern="[a-zA-Z]">

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Received on Wednesday, 16 January 2013 14:37:18 UTC