1👍
Below form should work.
<form id="user_form" method="post" action="/sign_up/" class="form-signin" role="form">
{% csrf_token %}
<h2 class="form-signin-heading">Signup </h2>
<input type="text" class="form-control" name="username" value="{{user_form.username}}" placeholder="Username" required autofocus>
<input type="password" class="form-control" name="password1" placeholder="Password" required>
<input type="password" class="form-control" name="password2" placeholder="Retype password" required>
<select class="form-control">
<option value="1">Librarian</option>
<option value="0">Borrower</option>
<option value="2">Clerk</option>
</select>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign Up</button>
</form>
Changes I have done are –
- Change the names of username and password textboxes
- Change the type for username textbox
- Added value attribute in select control
Source:stackexchange.com