title: Populate django form using dropdown menu for two fields
body: <p>forms.py</p>
  
  <pre><code>from django import forms
  
  class DataForm(forms.Form):
      ins = forms.CharField(max_length=100)
      contest = forms.CharField(max_length=100)
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>from django.shortcuts import render_to_response, render
  from django.http import HttpResponseRedirect
  from django.contrib import messages 
  from django.core.context_processors import csrf
  import mylife
  import codechef
  from codechef.models import chef, aprilcook
  from forms import DataForm
  
  def all_users(request):
      return render_to_response('C:/Users/shubham/Desktop/code_chef/project/mylife/codechef/templates/allusers.html', { 'user_list': chef.objects.all() })
  
  def print_table(request):
      return render_to_response('C:/Users/shubham/Desktop/code_chef/project/mylife/codechef/templates/tables.html')
  
  
  def display(request):
      if request.method == 'POST':
          form = DataForm(request.POST)
          if form.is_valid():
              print '-----------------------------------'
              print form
              print '-----------------------------------'
              insti = form['ins'].value()
              return render_to_response('C:/Users/shubham/Desktop/code_chef/project/mylife/codechef/templates/allusers.html', { 'user_list': chef.objects.filter(inst = insti) })
      else:
          form = DataForm() # An unbound form
  
      return render(request, 'forms.html', {
          'form': form,
      })
  
  def enter_data(request):
      form = DataForm(request.POST)
      return render(request, 'forms.html', {
          'form': form,
      })
  </code></pre>
  
  <p>forms.html </p>
  
  <pre><code>&lt;form action="/display/" method="post"&gt;{% csrf_token %}
  &lt;div class="form-group"&gt;
      &lt;label for="id_ins"&gt;select Institute Name&lt;/label&gt;
      &lt;select id="id_ins" class="form-control" size="1"&gt;
          &lt;option&gt;select Institute&lt;/option&gt;
          &lt;option value="National Institute of Technology, Kurukshetra"&gt;National Institute of Technology, Kurukshetra&lt;/option&gt;
          &lt;option value="Netaji Subhas Institute of Technology, New Delhi"&gt;Netaji Subhas Institute of Technology, New Delhi&lt;/option&gt;
          &lt;option value="Maulana Azad National Institute of Technology, Bhopal"&gt;Maulana Azad National Institute of Technology, Bhopal&lt;/option&gt;
          &lt;option value="Birla Institute of Technology Mesra"&gt;Birla Institute of Technology Mesra&lt;/option&gt;
          &lt;option value="Delhi Technological University"&gt;Delhi Technological University&lt;/option&gt;
          &lt;option value="Shiraz University"&gt;Shiraz University&lt;/option&gt;
          &lt;option value="Indian Institute of Information Technology, Allahabad"&gt;Indian Institute of Information Technology, Allahabad&lt;/option&gt;
          &lt;option value="Indian Institute of Technology Guwahati"&gt;Indian Institute of Technology Guwahati&lt;/option&gt;
          &lt;option value="National Institute of Technology, Kurukshetra"&gt;National Institute of Technology, Kurukshetra&lt;/option&gt;
          &lt;option value="National Institute of Technology Tiruchirappalli"&gt;National Institute of Technology Tiruchirappalli&lt;/option&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group"&gt;
      &lt;label for="id_contest"&gt;select contest Name&lt;/label&gt;
      &lt;select id="disabledSelect" class="form-control"&gt;
          &lt;option&gt;select Contest&lt;/option&gt;
          &lt;option value="JULY LONG"&gt;JULY LONG&lt;/option&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  
  &lt;div class="checkbox"&gt;
      &lt;label&gt;
          &lt;input type="checkbox"&gt;Agree terms
      &lt;/label&gt;
  &lt;/div&gt;
  
  &lt;button type="submit" value="Submit" class="btn btn-primary"&gt;Submit&lt;/button&gt;
  </code></pre>
  
  <p></p>
  
  <p>There are two fields in forms.py : ins and contest, both of which I wish to enter through dropdown menu in the html page. Now the problem lies in the forms.html. I am not able to  populate form fields using dropdown menu. When I use {{ form.ins }} and {{ form.contest }} it works(Data entered manually in textbox is received and correct page is redirected to), but it takes input in the form of textbox. <strong>I am not able to link dropdown menu with my django form</strong>. If I give {{ form.ins }} along with dropdown menu in forms.html then there appears both textbox input and dropdown menu of which only textbox functions properly, there remains no use of dropdown. I wish to recieve form input through dropdown menu and there should be no textbox input in hmtl page.</p>