There is a problem that can occur during form submission where the onclick handler is never called and the form doesn't submit. It only occurs on the iPhone and doesn't happen in OS X Safari. I've determined that in (at least one) case where this problem is happening that the onclick handler is not being called.

I've been working on this one on and off for months. I recently merged three issues in the Issues DB that cover this issue: #80, #137, and #177.

http://code.google.com/p/iui/issues/detail?id=80
http://code.google.com/p/iui/issues/detail?id=137
http://code.google.com/p/iui/issues/detail?id=177

I added these two comments to Issue 80

Comment #8:

There is a reproducible test case in web-app/test/form-test.html
Navigate to the 'Post to target="_self"' item and then touch "Submit" -- the clickHandler never seems to be called
on the current iPhone or iPhone simulator
Until we have a fix, you can run this test case directly from the GAE demo site:
http://iui-js.appspot.com/test/form-test.html


Comment #9:

After some painstaking debugging, I've determined that adding the following attribute to the form element
seems to fix the problem:

onclick="(function(event) {return true;})()"

I"m not sure what the actual problem is here. It might be a bug in Mobile Safari. Alternatively it is something complicated in event processing. For whatever reason, the above workaround seems to make the problem go
away.  Maybe it will give someone a clue as to what the real problem is.


I post this to the list because I'm not sure who gets automatic updates from the Issues DB and there may be others that may have run into this problem. I'm anxious to see if this workaround helps anyone else or even better may cause someone to come up with an even better solution.

-- Sean

--
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to