Hope you have solved this problem already.  I ran into a similar
problem today while trying to use something like
  task = request.POST.get('task')
which I thought should work since it worked for GET.  I have a large
list to pass back and GET did not have enough room.
I ended up doing something like this:

def addtask(request):
  post = request.POST.copy()
  task = post['task']
  a = "taskname" + str(tsk)
  r.write(a)
  return r

notice that I used post=request.POST.copy()
This helped my solution considerably.



On Sep 10, 6:25 am, bharathi <[EMAIL PROTECTED]> wrote:
> Hi,
>   I am using Django1.0
>   In thisrequest.POST.get() is not Working..It Gives empty value
>
>   My Views is:
>
>  def addtask(request):
>    r=HttpResponse()
>         ifrequest.method == 'POST':
>                task=request.POST.get('task')
>                 a = "taskname"+ str(task)
>                 r.write(a)
>         return r
>
> My Template is :
>
> function addtasks()
>
> {
>
> vartask=document.getElementById("task").value;
>    $.ajax({
>
>                                 url: "/simple2dos/addtask/",
>
>                                 type: "POST",
>
>                                 data: "val=1&task="+task,
>
>                                 success: function(feedback){
>                                   alert(feedback);
>                                 }
>               }):}
>
> <input type="text" id="task" name="task" value="">
> <input type="button" name="submit1" value="Submit"
> onclick="addtasks();">
>
> If i use GET instead ofPOSTmeans its working Fine..
>
> Please Help Me..
>
> Thanks
> Bharathi

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