On Sep 11, 3:11 pm, garonne <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I 've started playing with Django which seems very well for what i
> need but i still can figure out how to implement a very simple ajax
> example:
>
> I would like to have a form with a  textarea and after pressing the
> button, i wish to see the form and the text print below. For some
> reason i'm not able to keep both on the same page. I put my code
> below.

If you want both the form and the value of Entry to show at the same
time, you need to pass them both into the context. So this should
work...

def index(request):
    Entry = "No Entry"
    if request.method == 'POST':
        form = Form(request.POST)
        if  form['Entry'].data:
            Entry  = form['Entry'].data
    else:
        form = Form()
    return render_to_response('index.html', {'form': form,
'Entry':Entry})

--
DR.


--~--~---------~--~----~------------~-------~--~----~
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