Q:

Why my code does not show validation form error message?

Why my code does not show validation form error message?
I try something like this:
def index(request):
    if request.method == "POST":
        if request.POST['form-type'] == 'contact-form':
            form = AngebotForm(None, request.POST)
            if form.is_valid():
                form.save()
                msg = 'Good!'

                return render_to_response('index.html',{'msg':msg}, context_instance=RequestContext(request))

            else:
                form = AngebotForm()
        else:
            form = MessageForm(request.POST)
            if form.is_valid():
                form.save()
                msg = 'Good!'

                return render_to_response('index.html',{'msg':msg},context_instance=RequestContext(request))

            else:
                form = MessageForm()
    return render_to_response('index.html',{'a_form':AngebotForm(), 'm_form':MessageForm()},context_instance=RequestContext(request))

What am I doing wrong?

A:

Because in else part you are re-initializing the form which will loose the current state of form.
Just remove these lines:
else:
    form = MessageForm()

In the end your view should look like this:
def index(request):
    form = AngebotForm()
    m_form = MessageForm()
    if request.method == "POST":
        if request.POST['form-type'] == 'contact-form':
            form = AngebotForm(None, request.POST)
            if form.is_valid():
                form.save()
                msg = 'Good!'

                return render_to_response('index.html',{'msg':msg}, context_instance=RequestContext(request))
        else:
            m_form = MessageForm(request.POST)
            if m_form.is_valid():
                m_form.save()
                msg = 'Good!'

                return render_to_response('index.html',{'msg':msg},context_instance=RequestContext(request))

    return render_to_response('index.html',{'a_form':form, 'm_form':m_form},context_instance=RequestContext(request))

