Wednesday, May 29, 2013

input data will be lost if there are errors in the form

Hi,

    I find this very interesting.  In my html template form:

<form id="student-question" action="{% url 'app:poll' %}" method="post" enctype="multipart/form-data">
{% csrf_token %}
 
{{ form.title.errors}}
<div class="span12 question-title-form">
{{form.title}}
                                        .................
This is fine, and it will show the previous inputs if there are errors in the form, however, if I try to customize the html input field, for example, as below, instead of using automatic generated {{form.title}}
                                  <textarea id="titleInput" placeholder="Question Title" name="title" cols="50" rows="1"></textarea> 
                           
The previous inputs will be lost if there are errors in the form.  Does anybody know why?  I need some direction and explanation for this.  Thank you

Jeff



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment