I have dynamic select drop-down menus. For example, if you select a specific month, the 2nd select element will populate with number of days in that month.
This works as intended, however when the user is on an iPhone and uses the “Next” button built into Mobile Safari’s “form assistant”, the change event (using jQuery) doesn’t appear to fire and the 2nd select does not update.
$('.month').change(function() {
// update "days" select element
});
FYI I’m also using jQuery mobile
The best work-around I could find was based on this post…
Strange behavior of select/dropdown's onchange() JS event when using 'Next' on Mobile Safari Dropdown list item select box
Using the plugin (from the link above), I had to force the select menu to
bluras soon as an option was chosen with Mobile Safari’s “form assistant”.I noticed however when brute force testing these menus an extra
blurevent would fire after a few back-and-forth selections. An extrafocusseemed to fix that.With a separate
changefunction I am updating the second select menu dynamically.*Only tested on Mobile Safari / iOS 5.0.1 thus far.