I've built a modal link referencing a webform which works fine on desktop browsers but after submitting on an iOS device returns an Ajax error.

The webform does record the data and a Drupal message is displayed after the page is reloaded.

The Ajax debug code is long and I can't get the iOS devices to copy the output.

Any suggestions?

Comments

frjo’s picture

Status:Active» Postponed (maintainer needs more info)

A link to the site or another demo site with the same error?

jpsalter’s picture

http://fp2012.fivepaths-dev.com/

Scroll down to the blue "Contact us to get started" link. The form submission works fine on Chrome + MacBook Pro. But, not on an iOSX iPad and not in the iOS Simulator either.

ykyuen’s picture

I got the ajax error on the modal user register form in iphone. but it works on desktop and android.

muschpusch’s picture

Priority:Normal» Major
Status:Postponed (maintainer needs more info)» Active

Same here http://bit.ly/13h3EYc try to register on iOS.

memoo’s picture

ajax error appears on a modal webform on iphone+safari

it works on desktop and iphone+chrome

muschpusch’s picture

ok the weird thing is that i can't reproduce it on a clean install... :/ My setup is kind off complex using profile2, hook_form_alter the register form etc, etc.

@Memoo or @jpsalter is one of your setups more straight forward?

Here a minimum install of drupal with only modal_forms (and ctools) enabled.
http://modal.dev.rhizom.nl

muschpusch’s picture

Issue summary:View changes

Cleaned up text

eradeepak’s picture

Issue summary:View changes

i got same issue. any one help us...

ryanb24’s picture

Did anyone have any luck solving this issue? I'm getting an 'AJAX HTTP request terminated abnormally' on IOS devices but not on any desktop browsers.

Any help would be greatly appreciated.

jyoti@kiwicrate.com’s picture

I am also having this issue on iPad + Safari and iPhone + Safari. Please share any solution. Thanks in advance!

blind486’s picture

Same problem here using iPad with Safari, hope somebody can fix this...

sideswitch’s picture

Hi

I get the same behaviour in Safari browser on iPad and iPhone. This doesn't happen in Chrome on iPad.

(And I can't replicate on PC in any browser but haven't tested safari on pc)

Here is the link to some screenshots. I have been unable to actually copy out the text...
Screenshots of AJAX error

sarath.rajan’s picture

I am getting the same issue in ipad. Working well in the desktop browsers. Any solution to fix this?

beatnbite’s picture

I have the same problem

beatnbite’s picture

This seems to be a bug of jQuery 1.4.4 that is bundled with Drupal 7.
Installing jQuery Update module and enabling jQuery 1.10 in the module settings fixed the issue for me.

UPDATE: no, it doesn't fix the problem - the issue is there even with jQuery Update to 1.10

UPDATE 2:

So:
1. The mobile Safari has a plug-in that turns some numeric values into clickable phone numbers.
2. There is a special tag that should disable this behaviour (https://developer.apple.com/library/safari/documentation/AppleApplicatio...), but it did not work for me.
3. Good news: the plug-in parses HTML pages only (it uses the content-type header to detect the type).
4. Bad news: modal_forms module returns JSON data with a wrong content-type header (HTML instead of JSON), so the plug-in does parse it and replaces some data with clickable tags.

What I've done: I hacked into the sites/all/modules/modal_forms/modal_forms.pages.inc file and forced the correct content-type header to be sent before displaying the JSON response with "print ajax_render($output);".

--- a/sites/all/modules/modal_forms/modal_forms.pages.inc
+++ b/sites/all/modules/modal_forms/modal_forms.pages.inc
@@ -257,6 +257,11 @@ function modal_forms_view_webform($js = NULL, $node) {
}
}

+ // Standard JSON can be returned to a browser's XHR object, and to
+ // non-browser user agents.
+ // @see http://www.ietf.org/rfc/rfc4627.txt?number=4627
+ drupal_add_http_header('Content-Type', 'application/json; charset=utf-8');
+
print ajax_render($output);
}

As far as I see the problem is fixed finally - I can't reproduce it on my iPad.

There are other "print ajax_render($output)" lines - you are to hack them too if you enabled modals for other forms but the ones created by webforms module.

Of course, this is just a temporary hack, and a "proper" fix in the module is needed for this problem.

algates’s picture

@beatnbite you are life saver man, thanks its working fine

algates’s picture

@beatnbite if i am using webform validation module for modal webforms throw 500 internal server error, if you have any way to fix this issue, kindly share it, thanks in advance.

nicxvan’s picture

I am testing this now as well, I'll report back my findings.

nicxvan’s picture

This works for me!