I have a input field of type number
. I want to accept Persian/Arabic numbers as well in this field. I wanted to convert these numbers to English using jQuery, but it seems I can't retrieve these values.
jQuery('input[type="number"]').on('input', function() {
console.log(jQuery(this).val());
});
For non-English numbers val()
is empty string. Is there any way to get the value of a number input field, if the value is not a English number?
UPDATE:
Persian numbers: ۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹
English numbers: 0 1 2 3 4 5 6 7 8 9
UPDATE2:
Looks like Firefox returns the correct val
but Chrome returns empty string. So my question is applicable on Google Chrome.