Created
October 20, 2016 19:24
-
-
Save alexpirine/67f97c48d0b0c24182c3078ac0584fc2 to your computer and use it in GitHub Desktop.
Django's ModelChoiceField with empty_label generates an invalid <select>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Test</title> | |
</head> | |
<body> | |
<select id="id_some_field" name="some_field" required> | |
<option value="1">Value 1</option> | |
<option value="2">Value 2</option> | |
<option value="3">Value 3</option> | |
<!-- ... --> | |
</select> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment