MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
use jquery for other amount symbol blocking
Undo revision 28070 by Pcoombe (talk)
Line 297: Line 297:
// Block typing symbols in input field, otherwise Safari allows them and then chokes
// Block typing symbols in input field, otherwise Safari allows them and then chokes
// https://phabricator.wikimedia.org/T118741
// https://phabricator.wikimedia.org/T118741
$('#input_amount_other_box').on('keypress', function(e) {
document.getElementById('input_amount_other_box').onkeypress = function(e) {
var chr = String.fromCharCode(e.which);
var chr = String.fromCharCode(e.which);
if ("0123456789., ".indexOf(chr) === -1) {
if ("0123456789., ".indexOf(chr) === -1) {
return false;
return false;
}
}
});
};


// Disable submitting form with Enter key
// Disable submitting form with Enter key