views:

48

answers:

2

I tried the <input type="number" /> but on opera that outputs a strage input box coupled with a "up and down" handler, what i expected was a regular text field that once you focus on it prompts the number keyboard instead of the alphabets, is that even possible?

PS im not trying to validate, it would be a nice user experience thats all

A: 

The official HTML5 way to handle phone numbers is:

<input type="tel">

You may not have liked the "strange input box" you got with Opera when you used<input type="number" />, but that really is the appropriate type of input area when you want to require visitors to enter a numeric value.

Dori
but the "type=number" did not prompt the number pad, i'll try the tel type
Ayyash
im using opera 10 on windows mobile 6.5, i think its got some HTML5 in it, i know ive seen <a href="tel:"> work, input type didnt work though
Ayyash
The `type="number"` attribute isn't necessarily supposed to bring up a number pad. The question is: are you trying to force users to enter in a numeric value, or enter in a phone number? For the former, `type="number"` is what you want. For the latter, `type="tel"` (the telephone keypad, including # and *) is what you're looking for. `<a href="tel:">` isn't an input field; it's a link to dial a phone number. Example: `<a href="tel:1-408-555-5555">1-408-555-5555</a>`.
Dori
Dori whats wrong with you? did you get pissed off i didnt choose your answer? i said INPUT TYPE=TEL DID NOT WORK, and the upper answer gave me a link that showed me what im looking for will never be supported... I had to choose an answer, sorry i hurt your feelings!
Ayyash
@Ayyash, I'm not pissed off—I just think you're not paying attention. You asked about input in Mobile Opera. I told you how input works for the browsers installed on many 2010-era mobile phones. @fravelgue told you that many phones don't support HTML (irrelevant, because Opera does), how one type of link works (irrelevant, because they're not inputs), and about a 2001 WAP CSS specification which doesn't apply to Opera or to WAP v1 or to HTML input fields.And btw: no, you never did say that `input type=tel` didn't work for you—you said "i'll try the tel type" but never reported your results.
Dori
yes i did, look above
Ayyash
A: 

type="number" is HTML5 and many phone don´t support HTML. For call link you cand use type="tel" or <A href="wtai://wp/mc;600112233">Llamame!</A>. You should look at CSS WAP extensions (page 56) too.

fravelgue
i read that document, nothing there that makes a number pad prompt instad of alphabet, so it doesnt look like the future holds any hope for web developers :(i'll take that as a final answer
Ayyash
Dori
@Ayyash, sry i think i confussed with input and a. Anyway input type="number" is HTML5. You could use in iphone and android phones and i hope in future nokia browser.
fravelgue
@Dori WAP is dead (like HTML5 kill xhtml, do you know?!). But there are many browser that only support it, and there is functions of WAP that you can use in HTML MP. Remember every country is not USA or europe.
fravelgue