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

godboko71

  • What is that smell?
  • We-Gen
  • Weaving works on ipad again yippie! Should have checked more often I bet.
  • Posts: 288
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,
Robert Town Jr aka Godboko

live627

  • Talking Head
  • 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,412
HTML5 feature. It's the email input type.

Desktop browsers use it to help with form validation. Not sure what Android does.

Nao

  • With a Box
  • If you say so.....
  • Posts: 12,908
Yup. And Wedge supports most html5 custom input types. :)
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

godboko71

  • What is that smell?
  • We-Gen
  • Weaving works on ipad again yippie! Should have checked more often I bet.
  • Posts: 288
Thanks live Will look into it. Awesome Nao
Thank you,
Robert Town Jr aka Godboko

Arantor

  • With a Box
  • As long as the planets are turning, as long as the stars are burning, as long as your dreams are coming true...
  • Posts: 13,626
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.


Nao

  • With a Box
  • If you say so.....
  • Posts: 12,908
IIRC some browsers give you custom CSS to be able to restyle these warnings.
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Arantor

  • With a Box
  • As long as the planets are turning, as long as the stars are burning, as long as your dreams are coming true...
  • Posts: 13,626
I never looked to be honest, but it would be neat if they do.

Certainly if they don't now, they will going forward and hopefully in a cross-browser fashion.
  When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest.


Nao

  • With a Box
  • If you say so.....
  • Posts: 12,908
I'm positive that webkit does it at least.
...« I say wedge wedge (in the butt) »
 « Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)