Can you force numeric keyboard on mobile device: Numeric versus telephone keypad on iPhone: | XM Community
Skip to main content

Hi,
Is there a way to force a numeric keyboard on an iPhone (or any mobile device) versus a telephone keyboard?
My questions require mainly numbers but with some text, so a telephone keypad is not appropriate.
To force a numeric keypad on an iPad I have been using the following scripts:
jQuery("#"+this.questionId+" input[type='text']").attr('type', 'tel'); (using this for matrix tables)
jQuery("#"+this.questionId+" .InputText").attr('type', 'tel'); (using this for other question types)
This script results in the numeric keyboard being shown on the iPad, with the option to change back to text.
However, on an iPhone the above code only shows the “telephone” keypad. This means that respondents cannot change back to the standard text keyboard and thus are not able to enter text.
Is there a way to show the numeric keyboard rather than the telephone keyboard on a mobile phone device (as well as iPad) that allows respondents to enter numbers as well as text in the same question?
I require this as a large amount of numbers are being entered by respondents compared to only a small amount of text in each individual question. 

Try this:
jQuery("#"+this.questionId+" input[type='text']").attr('type', 'number'); (using this for matrix tables)
jQuery("#"+this.questionId+" .InputText").attr('type', 'number'); (using this for other question types)
Please accept as valid answer in case this works. :)

Happy holidays!


Leave a Reply