Wedge
Public area => The Pub => Off-topic => Topic started by: godboko71 on April 27th, 2012, 05:53 AM
-
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?
-
HTML5 feature. It's the email input type.
Desktop browsers use it to help with form validation. Not sure what Android does.
-
Yup. And Wedge supports most html5 custom input types. :)
-
Thanks live Will look into it. Awesome Nao
-
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)
-
IIRC some browsers give you custom CSS to be able to restyle these warnings.
-
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.
-
I'm positive that webkit does it at least.