I've got the following form that's fully working, but is just basic and ugly:
{{ form.non_field_errors }}
<form method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>
When I try to convert it to a bootstrap form, like below, the Submit button does not actually submit changes. Any idea why this isn't working? When I hit Submit the values display as None, and when I go back to my selection screen the edits are not updated (they are also not updated in the backend database). Any idea what's wrong?
{{ form.non_field_errors }}
<form method="post">{% csrf_token %}
<div class="form-group">
{{ form.stakeholder_group.errors }}
<label for="{{ form.stakeholder_group.id_for_label }}">Stakeholder Group</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Add a Stakeholder Group" value="{{ form.stakeholder_group.value }}">
<small id="emailHelp" class="form-text text-muted">What group(s) is this invdividual associated with?</small>
</div>
<div class="form-group">
{{ form.employee.errors }}
<label for="{{ form.employee.id_for_label }}">Employee Name</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Log the employee" value="{{ form.employee.value }}">
<small id="emailHelp" class="form-text text-muted">Who does this individual report to?</small>
</div>
<input type="submit" value="Submit"/>
</form>
Updated:
<form method="post">{% csrf_token %}
{% for field in form %}
<div class="form-group">
{{ field.errors }}
{{ field.label_tag }}
<label for="{{ form.stakeholder_group.id_for_label }}"></label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Add a Stakeholder Group" value="{{ field.value }}"> {{ field }}
<small id="emailHelp" class="form-text text-muted">What group(s) is this invdividual associated with?</small>
</div>
{% endfor %}
<input type="submit" value="Submit"/>
</form>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…