0

What I am trying to do is have a form that has this HTML:

        <form method="post" action="">
            {% csrf_token %}
            <label>Pick a class:</label>
            <select id="schedClass" name="schedClass" >
                        <option>Select one</option>
                {% for i in classes %}
                    <option value="{{ i.id }}">{{ i.name }}</option>
                {% endfor %}
            </select>
            </select>
            {{ form }}
            <input type="submit" value="reload">
        </form>

The problem is that for some reason when I submit, the select schedClass doesn't appear in the link. I think it comes from the fact that it's integrated with a django form, but I have no idea.

For clarification, what I am trying to do is have a form that creates an instance of a specific model, and one of the categories is schedClass which is a ManyToManyField, but I can't use a ModelForm since I need the items in the selections to be only ones that are also linked to the user with another ManyToMany.

Is there anything to do?

Shufi123
  • 233
  • 3
  • 11

0 Answers0