Re: [suggestion] Another field type for HTML form inputs

Hi Felipe,

The example under <input type=number> uses a currency example:
http://www.w3.org/html/wg/drafts/html/master/single-page.html#number-state-(type=number)

Is that not sufficient?

Cheers,
Silvia.

On Wed, May 15, 2013 at 12:56 AM, Felipe Nascimento de Moura
<felipenmoura@gmail.com> wrote:
> Hi.
>
> This is something I see a lot of people doing by themselves across the
> internet, or using libraries to do so. To format currency/money inputs.
>
> Therefore, I believe it would be useful if HTML could provide an input with
> type currency.
>
> Once the Operational System knows the user's preferences related to
> currency, money symbols and format, the browser should be able to render it
> with a better solution.
> Mobile devices could change their keyboards to only numbers, comas and
> points..maybe the symbol($) as well.
> These inputs, could have a mask applied, according to the currency (let's
> say, in Brazil, the currency format is 1.234,56 while in most countries it
> is 1,234.56).
>
> CSS could be able to change its "mask" as it changes list-styles, for
> example.
>
> input[type=currency]{
>     thousand-separator: coma;
>     decimal-separator: point;
>     symbol-visibility: focus; /* shows the symbol only when the input is in
> focus */
>     symbol: none;
>     negative: visible; /* allows the negative symbol */
> }
>
> I wounder symbol might be a keyword like "real", for brazilian currency
> (R$), dollar, us-dollar, aus-dollar, euro, etc...or it could be the string
> with the symbol, itself!
>
> Plus, there could be a few states for the element, such as:
> input[type=currency]:negative{
>     color: red;
> }
> input[type=currency]:positive{
>     color: green;
> }
>
> Also, those configurations could be defined in the HTML element
> itself...something like:
> <input type="currency" thousand="." decimal="," />
>
> Masks with JavaScript are expensive, there are thousands of them, each
> working in different ways.
> When building web-apps, it would make a lot of difference!
>
> So, I want to hear from you what is your opinion about it.
>
> Thanks for your time.
>
> --
> Felipe N. Moura
> Senior Web Developer
>
> Website:  http://felipenmoura.org
> Twitter:    @felipenmoura
> LinkedIn: http://goo.gl/qGmq
>
> Meet some of my projects:
> BrazilJS Conference  |  BrazilJS Foundation  |  Power Polygon  |  TheWebMind
> |  PHPDevBar
> ---------------------------------
> LinuxUser #508332
> Changing  the  world  is the least I expect from  myself!

Received on Wednesday, 15 May 2013 09:47:04 UTC