It seems weird, true. It might be my mistake, but I can't seem to
figure it out. Here it is:
form:
class CustomerForm(forms.Form):
username = forms.CharField(label=_('Username'), max_length=30)
first_name = forms.CharField(label=_('First name'), max_length=30)
last_name = forms.CharField(label=_('Last name'), max_length=30)
email = forms.EmailField(label=_('Email)
...
----
view:
def customer(request):
if request.method is 'POST':
form = CustomerForm(request.POST)
else:
form = CustomerForm()
...
return render_to_response('customer.html', {'form': form},
context_instance=RequestContext(request))
----
template:
...
<form action="/customer/" method="POST" class="checkout">
<fieldset>
{{ form.as_p }}
</fieldset>
<input type="submit" value="{% trans "Submit" %}" />
</form>
...
On Mar 2, 1:28 am, Michael Newman <[EMAIL PROTECTED]> wrote:
> When you render the form out like that it should also render any
> errors as well. I never used the older versions (non-svn) of Django
> and newforms so I can't say this for certain. Post your view code and
> I will take a look at it to see if there are any errors there. Also
> just double check the source of the code and make sure the errors are
> being hidden in the markup.
>
> On Mar 1, 10:24 am, Panos Laganakos <[EMAIL PROTECTED]> wrote:
>
> > I've started using newforms, and so far they feel much better.
>
> > A question though, I'm using the default rendering in my templates, ie
> > {{ form }} or the variants {{ form.as_p }} etc.
>
> > When the form does have errors, I don't get them displayed. Is that
> > the way it should happen? If so, I suppose I'm forced to write the
> > template form myself, rather than generate it, so I can get
> > form.<myfield>.errors after each field.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---