Getting the number pad to show up for text fields I would like to make entering data easier for my users who use the mobile version of my site. I've been searching around both Android and Drupal documentation and eventually found this: https://stackoverflow.com/questions/3372380/how-to-force-keyboard-with-numbers-in-mobile-website-in-android

Which says that using 

&lt;input type="number" /&gt;
&lt;input type="tel" /&gt;


will bring up the number pad for the user. 

I would like to figure out the best way to change all of my integer and decimal fields to have type="number".

I'm aware of doing a hook to do this but I have a lot of fields which are numbers and I was wondering if there was a more effective way to change ALL the fields rather that me writing a line for each of the fields. Maybe if I had an array of all the fields and then programically went through all the fields in the array? 

Thanks
hook_field_widget_form_alter


  Alter forms for field widgets provided by other modules.


or use hook_field_widget_WIDGET_TYPE_form_alter to hook into the Number field specifically.

/**
 * Implements hook_field_widget_WIDGET_TYPE_form_alter().
 */
function mymodule_field_widget_number_form_alter(&amp;$element, &amp;$form_state, $context) {
  $element['#type'] 'number';
}