Make/detect the iPhone/iPad post back on double tap - iphone

In an asp.net web application - without writing a mobile specific site, is there anyway of stopping double tapping on an iPhone, from zooming? The default behaviour should be to produce a postback (and is on my Android, and in normal web browsers) - but the iPhone appears to take this as a zoom command.
So my query is, how do I get the iPhone/iPad to recognise that I actually want to do a postback?
Thanks for any help,
Mark

if anyone is interested, my specific issue was, I had a popup on each cell of a grid (onmouseover...) - however, to start the postback, you have to actually click on a cell in the the grid, rather than hover over it. However, "hovering" on an iPhone is basically "clicking" on everything else - so when people were clicking, all that was happening, was the popup was showing again, and no postback was carried out - meaning people could not progress.
Solution was to detect for iPhone/Pad/Touch, and not output the "onmouseover" if those devices were detected - then the underlying click was available, and would do as designed.
Code to check for iPhone etc:
Dim iphone as Boolean = False
Dim userAgent = HttpContext.Current.Request.UserAgent.ToLower()
' iPhone is there
If userAgent.Contains("iphone") Then
iphone = True
ElseIf userAgent.Contains("ipad") Then
iphone = True
ElseIf userAgent.Contains("itouch") Then
iphone = True
End If
Hope this helps anyone else with this specific issue,

Related

Actions on Google - configure Simulator to display my test app

My test app is displayed only on the 'display' tab and not on the conversation menu on the left.
Expected:
Actual:
How can it be fixed?
A short term fix, until the bug in the simulator is resolved, is to change your surface. You can switch to speaker if you want to hear the response. Note that you can only swap surfaces when you are not in an active conversation, if you are in one, just click cancel, and then switch surfaces. If you do switch to speaker you will not see the display anymore, but it will say the question you are seeking. Please don't be discouraged, this was not a bug in your code, it is in the simulator.
it is only the first TTS (i.e Welcome! ... ) that you may not hear back the audio file. It is a bug and they are working to fix it. But as long as you see "Welcome!..." in the display card now, your action is working

Has the iOS9 update caused C# codes not work properly?

I have a piece of code which is not working after the iOS9 update on devices, specifically Safari browser (Both iphone and ipad). It works fine in Chrome on the device using iOS9 but Safari is having sme kind of issue which I'm unable to debug. There was no issues in both the browsers on the device till iOS8.
Basically the functionality is a person needs to select 2 images from a set of images and click the GO button. If the images match with the ones saved at backend(DB) then he gets navigated to the next screen, else it shows a Cross symbol and refreshed the page asking the User to select the images again.
Please help and thanks.
Below is the piece of code which I feel is having the issue :
string cbref = Page.ClientScript.GetCallbackEventReference(this,
"arg", "fnGetOutputFromServer", "context");
string cbScr = string.Format("function fnCallServerMethod(arg," +
" context) {{ {0}; }} ", cbref);
Page.ClientScript.RegisterStartupScript(GetType(), "fnCallServerMethod", cbScr, true);
I put an alert within fnGetOutputFromServer but that never showed up in the device Safari browser. Please help me as I feel totally confused as to why it is not working. Also, I'm okay if I have to change the whole line to put a work around to this or by directly calling the function or something.
Note : This works fine in Chrome on an iOS9 device but does not work in Safari and the same works fine while emulating as iphone/ipad on the PC
Thanks again in advance.
http://www.brillianceweb.com/blog/article/69/aspnet-20-misidentifies-safari-71-on-ios-and-os-x
This fixed it !!! :)
I had to get the latest AppleWebkit version for iOS9 and got it updated in the configuration file which resolved the issue

Html forms and mobile web browsers problem

Mobile keyboard (Android IPhone) has no tab button. That is why native application go to next field when enter is pressed. However browser forms are submitted when enter is pressed.
How can I solve this problem?
Use tabindex properly and it should work just like with native applications.
By the way, on Android at least, native apps don't have to do anything special to get this behavior (at most they have to specify nextFocusForward, if the layout is too complicated and Android can't figure that out by itself).
I assume you're talking about the on-screen keyboard. iPhone will show Previous | Next as a keyboard accessory in web forms. Android will too.
If they don't then something might be wrong with your markup. Is it possible for you to post your form HTML code?
I would also say that nLL's suggestion is correct. It will make it feel more polished.
since you are targeting high-end phones you can handle enter key with simple JavaScript
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
//Do something
}

How do you disable phone number detection in mobile safari

I have tried to disable phone number detection in safari for my web app but it still shows 7 character strings comprised of numbers as phone numbers. I used the apple provided meta tag but no joy.
<meta name="format-detection" content="telephone=no">
Anyone else run into this problem and work around it?
Thanks.
Update: It looks like it does not detect phone numbers in safari but rather when I save the page as an icon and run it from the home screen.
Are you loading this in a UIWebView? If so, you need to set the property for dataDetectorTypes. e.g:
webView.dataDetectorTypes = UIDataDetectorTypeNone
Valid detector types are here.
Search for UIWebView on apple's site for a description of how to set the property there.
-Kevin
We had a similar problem on our JQM/Cordova app. We had a calculator built into the app and whenever the amount was more than seven digits the data would be in blue with an underline underneath and when you click on the data a pop up appeared and gave you the option to call. We simply added
the meta tag as described in the opening question & it worked.
Just adding some thought here in case anybody else has a similar issue with Safari detecting 7 stringed data as telephone numbers.
OK. After quite a bit of futzing I think I found a strange work around. The problem with using dataDetectorTypes is that it will disable phone number detection for the whole uiwebveiw.
After trying datadetectors="off" and x-apple-data-detectors="false" attribute on span and a tags I finally stumbled on something that seems to prevent phone number detection.
If I wrap my text in an a tag with an href="#" apple seems to leave it alone.
Try this Code,
webView.dataDetectorTypes = UIDataDetectorTypeNone;
This may help you.
Try and add this to YourProjectAppDelegate.m
// ...
- (void)webViewDidStartLoad:(UIWebView *)theWebView
{
theWebView.dataDetectorTypes = UIDataDetectorTypeAll ^ UIDataDetectorTypePhoneNumber;
return [ super webViewDidStartLoad:theWebView ];
}
// ...
Did the trick for me..

Set textbox focus in mobile safari

Hey, I was wondering how to set the focus to a text box in Mobile Safari.
I've tried document.myForm.myTextArea.focus() which works in regular Safari, but it does not seem to work in Mobile Safari.
To clarify, I want to set focus to a text box as soon as the user loads a page, and have the iPhone keyboard pop up.
Just found this previous post stating this is a bug in webkit. Sorry for not doing a more thorough search.
http://discussion.forum.nokia.com/forum/showthread.php?t=127724
I found a bug report with the iUI project relating to this.
It seems that a focus() call will not work if called from the onload event or if called via a timer.
http://code.google.com/p/iui/issues/detail?id=129
Update: Although I have no source for this, I am told (by people who have tried it) that in iPhone OS 4 the problem with focus() and onload should be fixed.
Nothing to do with the timer, focus() doesnt work at all... im doing mine through an AJAX function. i guess my web application will have to suffer in mobile safari.
Bye the way, this also affects HP webOS devices and any other device using mobile safari