Wednesday, December 9, 2009

Question about forms in templates

Hi,

I'm not very clear on how forms work.
In the form below, both fields are required. When not filling anything
and clicking submit, I got the error messages.
Since I didn't specified any action, how can the form know that the
form is not valid and get the error messages?

Thanks for any explanation/pointer.
jul

<form action="" method="POST">
<p><label for="id_name">Name:</label>{{form.name.errors}}
{{ form.name }} </p>
<p><label for="id_country">Country:</label>{{form.country.errors}}
{{ form.country }} </p>
<!-- More stuff -->
<p style="clear: both;"><input type="Submit" id="submit"
value="Submit" /></p>

--

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate