html - Display the post data after error in django and html5 -


django form

{% field in form.fields %}     {{field}}   </div> {% endfor %} 

if there error {{field.email}} output html post data value

<input id="id_email" type="text" value="gffdg" /> 

i want use html 5 inputs don't know how post value if there error

<input id="id_email" type="email" > 

edit..

i hoping not use widgets django forms , type html5 code in template (type="email" not type="text")

<input id="id_email" type="email" >` 

but can't figure out how value after post errors.

<input value="?????" /> 

if trying bound value of email field, following template code should work:

<input id="id_email" type="email" value="{{ form.email.value }}"> 

if value not set, blank field.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -