Female Genital Mutilation

Here's one way to cause submit clicks to fail to fire in jQuery Mobile: just add CSS margins to your

What's happening:

jQM’s visible wrapper element copies all the classes applied to the actual input element, to which jQM and app css styling is applied. If you give the button a top or left margin, it causes the position of the actual input element to shift “within” the wrapper element, so that clicks in the top and left of the visible element miss the actual submit element! A terrific way to produce what seems like a random failure in the field.

You can see this in the attached debug screenshot, with the actual submit element geometry highlighted.

A fix is:

    $("#createButton").parent().click(function() {$("#createButton").click()});

Thus catching a click on the wrapper element and forwarding it to the actual submit element.

Clearly a bad design in jQM. If they are going to "move" decorations to a wrapper element, they need to remove them from the wrappered element. There are many complaints about jQM submit not firing on the web, and I suspect that many are this problem.