title: Django template, how to make a dropdown box with the predefined value selected?
body: <p>I am trying to create a drop down list box with the selected value equal to a value passed from the template values, but with no success. Can anyone take a look and show me what I am doing wrong.</p>
  
  <pre><code>     &lt;select name="movie"&gt;
         {% for movie in movies %}
      {% ifequal movie.id selected_movie.id %}
       &lt;option value="{{movie.key}}" selected="true"&gt;Movie {{movie.id}}: {{movie.name}}&lt;/option&gt;
       {% endifequal %}
       {% ifnotequal movie.id selected_movie.id %}
       &lt;option value="{{movie.key}}"&gt;Movie {{movie.id}}: {{movie.name}}&lt;/option&gt;
       {% endifnotequal %}
         {% endfor %}
       &lt;/select&gt;
  </code></pre>
  
  <p>In this example, movies and selected_movie are passed from the template values.
  Please advice!</p>