I've seen examples from other websites where when a form is submitted
and some of the required fields contain no data.  It takes them back
to the same url and displays messages like '*** This field is
required' above the form field.

I currently have my form setup so that when it's submitted and some
required fields are missing it then takes them to a different url and
display's the error messages.

////////////////

def checkout(request):
        if request.method == 'POST':
                f = ContactForm(request.POST)
                a = theamount(request)
                if f.is_valid():
                        request.session['orderdetails'] = {
                            'amount': a,
                            'card_number': request['card_number'],
                            'exp_date': request['exp_date'],
                            'b_firstname': request['b_firstname'],
                        return HttpResponseRedirect('/rugs/cart/success')
                else:
                        return render_to_response('error.html', {'e': f.errors})
        else:
                f = ContactForm(auto_id='%s')
                return render_to_response('checkout_form.html', {'fo': f, 'o':
request.session['cart'], 'p': theamount(request), 'spad':
request.session['pad']})


///////////////////

How do I show the error messages on the same page which in this case
is checkout_form.html?

Thanks


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to