Different Keys (touch screen keyboards) for different form elements?

godboko71

  • Fence accomplished!
  • Hello
  • Posts: 361
So I was given an iPad 2 a couple of months ago and I noticed some websites forms where smart, if it was email the @, -, and _ where on the main keyboard instead of having to goto the numbers or special characters parts of the keyboard.

I was wondering is there a standard all smart devices use for that feature or is it something that can only be targeted to Apples Safari Browser?
Thank you,
Boko

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Nao

  • Dadman with a boy
  • Posts: 16,082

godboko71

  • Fence accomplished!
  • Hello
  • Posts: 361

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Different Keys (touch screen keyboards) for different form elements?
« Reply #4, on April 30th, 2012, 02:33 PM »
To explain, you can use <input type="email"> instead of <input type="text">, and non-compliant browsers will just render a standard textbox but ones that are compliant and where it makes sense will do something different; Mobile Safari at least will give you the email-centric keyboard.

There are other advantages for this, too, e.g. type="number" where you can set optional min and max and step for the number, e.g. you can set min=2, max=10 and step=2 and compliant browsers will only allow you to submit the form if the number in the box is between 2 and 10 in steps of 2, e.g. 2, 4, 6, 8, 10. (Non-compliant ones only treat it as a regular textbox but it's a nice way of doing things, but it does use browser UI rather than any custom UI, so you might want to use your own UI if you custom-validate other elements and display warnings client-side before sending the form off)
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

Nao

  • Dadman with a boy
  • Posts: 16,082