title: Django simple form "object has no attribute 'is_hidden'"
body: <p>I'm trying to render a simple form with no db models but I am getting error. Following is the code:</p>
  <pre><code>from django import forms
  from django.utils.safestring import mark_safe
  class ContactForm(forms.Form):
      category_options = (
          ('select category', '--Select Category--'),
          ('fire safety', 'Fire Safety'),
          ('batteries/solar panels', 'Batteries/Solar Panels'),
          ( 'cctv systems','CCTV Systems')
      )
      category = forms.ChoiceField(label=&quot;Select a Category&quot;, choices=category_options, required=True)
      full_name = forms.CharField(required=False)
      email = forms.EmailField()
      phone = forms.CharField(widget=forms.IntegerField)
      message = forms.CharField(widget=forms.Textarea(attrs={'cols': 10, 'rows': 10}))
  
      def clean_email(self):
          email = self.cleaned_data.get('email')
          
          return email
  </code></pre>
  <p>I'm not getting the phone field right. I need to add validation for phone numbers and couldn't figure out the right way to use widget for IntegerField.</p>
  <p>I need to find the accurate way of adding a phone field.</p>
  <p>I'm getting the error:</p>
  <pre><code>AttributeError at /contact/
  'IntegerField' object has no attribute 'is_hidden'
  </code></pre>
  <p>I get following results when I use</p>
  <pre><code>phone = forms.CharField(widget=forms.NumberInput)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/qAT4h.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qAT4h.jpg" alt="enter image description here" /></a></p>
  <p>My html generated from the python code for different fields is following:</p>
  <pre><code>&lt;p&gt; 
  &lt;label for=&quot;id_email&quot;&gt;Email:&lt;/label&gt;
  &lt;input id=&quot;id_email&quot; name=&quot;email&quot; type=&quot;email&quot;&gt;
  &lt;/p&gt;
  
  &lt;p&gt; 
  &lt;label for=&quot;id_phone&quot;&gt;Phone:&lt;/label&gt;
  &lt;input id=&quot;id_phone&quot; name=&quot;phone&quot; type=&quot;number&quot;&gt;
  &lt;/p&gt;
  </code></pre>
  <p>Both my fields above are generated with python code but email field is applying template css properly. But &quot;Phone&quot; field is not rendering css.</p>
  <p>Please advise.</p>