Is it possible to disable the \'next\' and \'previous\' buttons in Mobile Safari when focused on an input field? I\'ve been trying the method of setting all fields to
So far the best solution for me (based on Jezen Thomas solution) is to set on focus
readonly
to input
s and textarea
s and disabled
to select
s, and remove them on blur
:
jQuery('input, textarea, select').on('focus', function() {
jQuery('input, textarea').not(this).attr("readonly", "readonly");
jQuery('select').not(this).attr("disabled", "disabled");
});
jQuery('input, textarea, select').on('blur', function() {
jQuery('input, textarea').removeAttr("readonly");
jQuery('select').removeAttr("disabled");
});
Only one flaw is that you need to drop focus (for example clicking on background) before changing from input
/ textarea
to select. But you can easily change your focus between input
s and textarea
s.