How to prevent iPhone to interpret "AD 800-1200" as phone numbers? [duplicate] - iphone

This question already has answers here:
How to disable phone number linking in Mobile Safari?
(24 answers)
Closed 8 years ago.
I am developing a mobile website and on a page there is text such as "AD 800-1200". If I press this text and release, iPhone asked me whether to dial a number.
How to prevent this?
Thanks!

See the following html:
<html>
<div id="s2">AD 800&#8232-1200</div>
<div id="s2">AD 800-1200</div>
<div id="s2">AD 800 - 1200</div>
<div id="phone">(800)123-4567</div>
</html>
The first and third line produce "no phone number", while the second and fourth do. You can see for yourself at http://www.floris.us/SO/phoneme.html
Note - the "magic number" in the first example is a unicode control character that does not render to the screen - but it does throw the "number parser". With this trick you can have a number that "looks" exactly like a phone number, but doesn't get recognized as such.
The third example just adds spaces around the hyphen - that seems to work too.
I can't claim all the credit for this cleverness. I did see https://stackoverflow.com/a/17507409/1967396 ...
One other thing: you can add the following line to the header of your file:
<meta name="format-detection" content="telephone=no">
This will turn off telephone number detection. This latter trick can be found at https://stackoverflow.com/a/227238/1967396 - with thanks to Aaron Brager for bringing it to my attention.

If you are using a webview uncheck the property "Phone Numbers detection" in your XIB

Related

Question marks where should be an X

I'm using Zend Framework and Twitter Bootstrap for a website. From twitter bootstrap I'm using things like the alert:
<div class="alert">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Warning!</strong> Best check yo self, you're not looking too good.
</div>
Where an X is supposed to appear, appears a question mark (?). I have my charset as UTF-8.
That is not the only thing that is happening but in many places where I'm supposed to have Spanish characters what appears is a question mark. Does anybody know what's wrong? Thanks!
Dito, you might just put an simple x there instead of the multiply sign. You can also check out if it works with this HTML entity:
×
I've learned that encoding is a very difficult topic. There is the doctype declaration in your document – but there is also the web server (apache?) declaration and even a PHP setting. You can check out your website settings by hitting cmd+I (ctrl+i on a pc/linux) in FireFox.
My Hex editor told me that it is × and not x .
Remove charset from your meta in html and try again. Also, try to replace that with a 'real' x.

iPhone Numeric Keypad with Decimal for web apps?

I know with native iPhone apps you can use UIKeyboardTypeDecimalPad to force a numeric keypad with a decimal. Is there any way to force this same keypad for an input field on a mobile webpage or web application? If not yet, does anyone know if this detection will be added to Safari in iOS 6?
I am able to display the regular numeric keypad without issues, but I'd really like to have the decimal key so I don't need to display the full keyboard.
Thanks!
Checkout inputmode="decimal" attribute.
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
Not widely supported yet but it comes available in iOS 12.2.
https://caniuse.com/#feat=input-inputmode
This is not possible, however there is a slight hack, which you can use.
Look at this link - http://web.archive.org/web/20151110014447/http://www.brownphp.com/2011/05/iphone-currency-input-web-apps/
Once the user starts writing/typing in the field it starts adding the numbers this way - 0.01 -> 0.12 -> 1.23 -> 12.34 . So this can be used for similar effect.
Also here is a overview of the input types for web apps, where you can see it is not possible to use the input type with numbers and a decimal point.
http://www.fabianpimminger.com/web-development/how-to-change-the-iphone-on-screen-keyboard-in-web-apps/
Add inputmode="decimal" attribute to the input tag.
<input id="price" type="number" min="0" inputmode="decimal">
Check other input modes at https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
Apple documentation lists number as an input type:
A text field for specifying a number. Brings up a number pad keyboard in iOS 3.1 and later. Specifying an input type of \d* or [0-9]* is equivalent to using this type.
Problem with number is that it will only accept integers. I found this where he mentions adding step="any". Now you get the numeric keypad and can enter decimals.

iphone input type (number with two decimals)

I'm developing an iphone application with phonegap, this means my application is in html5, javascript and css. I have a form with a field for weight on an object. I'm trying to get an input type similar to;
<input type="time"/>
Html5 supports different types of input, and this will toggle a different keyboard for the iphone, for example the numeric keyboard for numbers. The one I'm looking for is the one where you can roll vertically over numbers. Like when you set your alarm clock on the iphone, example below.
http://blog.ringtonefeeder.com/wp-content/uploads/2009/01/iphone-alarm.png
The input type="time" gives me that, but it's restricted to 24 hour window and 1-59 minute window.
Is there anyway to customize this input type so I can get a 2 decimal number? in the range of 0-999.99 kg.
I realize this is a vague question but it's hard to explain.
Have a look at inputmode="decimal" attribute.
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
Not widely supported yet but it comes available in iOS 12.2.
https://caniuse.com/#feat=input-inputmode
As far as I know, there's no way of doing this in the PhoneGap world. You can view the available keyboards here. You could probably roll your own if you're capable in objective-C, but then you'd have a create a plug-in for it so PhoneGap could see it.
One of the keyboards not shown on that page is: UIKeyboardTypeDecimalPad, which is a telephone keypad with just numerals and a decimal point, which might also work for your application. Shown here:
However, I've been unable to figure out how to have it shown via HTML.
If you want the telephone keypad, you'd use:
<input type="tel">
Similarly if you wanted a numeric keypad, it'd be:
<input type="number">
As far as I know (and someone please correct me if I'm wrong), there's no equivalent for UIKeyboardTypeDecimalPad like this made up type:
<input type="decimalNumber">

Stop Email Clients from auto-linking/styling dates?

Is it possible to stop Email Clients (iPhone, Mail.app, Sparrow..) from auto-linking or otherwise changing the style of dates in an email.
I want to style date/timestamps in emails as a light unassuming gray - however most mail clients turn this into a link with the traditional underline/blue combo. I am interested in blocking this from the HTML side if possible.
I'm assuming that the issue is that they change the style - you end up with blue underlined phone numbers, for example.
Some clients have a custom meta-tag to let you do this. e.g. for Mail.app and iOS:
<meta name="format-detection" content="telephone=no" />
However, others don't. What you can do instead is add your own link and style that to appear exactly the same as the text around it.

Float number is displayed as phone number for Opera-mobile

I'm developing small web-mobile application. Some my page contains float number. But on Opera-mobile this number is displayed as link to deal phone number. I have found similar issue for Safari:
<meta name="format-detection" content="telephone=no"/>
But this doesn't works for Opera-mobile. How to to fix it?
Although likely not the best solution you can use javascript to find the <a href="tel..." blocks and remove the href attribute from there.