Numeric field type in Form API I am trying to add a "number" field type to a form using FAPI:

$form['phone_number']['areacode'] = array(
  '#type' =&gt; 'textfield',
  '#title' =&gt; '---',
  '#width' =&gt; '30%',
  '#align' =&gt; 'center',
  '#required' =&gt; true,
  '#maxlength' =&gt; 3
);


I change the TYPE to "number" and the field doesn't get generated at all. The number module is enabled. I have implemented the following theme functions:


MYTHEME_form_element
MYTHEME_textfield
MYTHEME_container


What could be behind this field not showing up when I use #type = number or #type = number_integer, etc?

This might have something to do with it:

Creating Number fields (integer and decimal) manually in code for custom forms

However I actually want the type to render as "number" in HTML so smart phones show a numeric dialer

Any ideas?
$form['my_element'] = array(
    '#type' =&gt; 'textfield',
    '#attributes' =&gt; array(
        ' type' =&gt; 'number', // insert space before attribute name :)
    ),
    '#title' =&gt; 'My number',
    '#required' =&gt; true,
    '#maxlength' =&gt; 3
);