views:

89

answers:

1

In the following code, i have a drop down box and a multi select box.

My question is that using javascript and django .how will i changes the designation with changes in names from drop down box.

        <tr><td>
           name:</td><td><select id="name" name="name">{% for name in names %}
     <option value="{{name.id}}" {% for selected_id in names %}{% ifequal name.id selected_id %} {{ selected }} {% endifequal %} {% endfor %}>{{name.name}}</option>{% endfor %}
        </select>
        </td></tr>

        {% for desg in designation %}
        <tr><td><p>Topics:</td><td>  <select id="desg" name="desg" multiple="multiple">
        <option value="{{desg.id}}" >{{desg.desg}}</option>
        </select></p></td></tr>
        {% endfor %}

Thanks..

A: 

Use something like jQuery to perform a POST request with the name to another view which will return the new designations as JSON, then replace the returned values into the other select.

Ignacio Vazquez-Abrams