Re: No POST data

2007-05-03 Thread Brian Luft

>From http://www.w3.org/TR/html4/interact/forms.html#h-17.12:

"In this example, the INPUT element is disabled. Therefore, it cannot
receive user input nor will its value be submitted with the form."

Try removing the disabled attribute from the input.

If you still need to submit the value from that form you might try
some pre-submit processing and transfer the value to a hidden field.

Cheers
-Brian

On May 3, 11:36 am, tomass <[EMAIL PROTECTED]> wrote:
> I realise this is likely something trivial I am missing, and I'm aware
> ofhttp://code.djangoproject.com/wiki/NewbieMistakes...
>
> However, I have a form that's set up like this:
>
> From:  disabled id="date_from" name="date_from" value="04/25/2007" size="10"
> maxlength="12" readonly="readonly" />Calendar.setup({ inputField : "date_from", button :
> "date_from_cal" }); To:  name="date_to" value="04/28/2007" size="10" maxlength="12"
> readonly="readonly" /> id="date_to_cal" style="cursor: pointer; vertical-align: top !
> important;" />Calendar.setup({ inputField : "date_to", button :
> "date_to_cal" });  (Oldest Log: Wed, 25 Apr 2007 09:12:26 +2000, Newest Log Fri,
> 27 Apr 2007 10:31:56 +2000)
>
> my urls.py looks like this:
>
> urlpatterns += patterns('monitor.zopelog.views',
> (r'^landscape/logs/$', 'index'),
> (r'^landscape/logs/(?P\d{8})/(?P\d{8})/$',
> 'index'),
> (r'^landscape/logs/daterange/$', 'parsedate'),
> )
>
> and here's my parsedate function:
>
> def parsedate(request):
>
> date_from = request.POST['date_from']
> date_from = date_from.split('/')
> date_to = "%s%s%s" % (date_from[2], date_from[0],
> date_from[1])
>
> date_to = request.POST['date_to']
> date_to = date_to.split('/')
> date_to = "%s%s%s" % (date_to[2], date_to[0], date_to[1])
>
> return HttpResponseRedirect('/landscape/logs/%s/%s/' %
> (date_from, date_to))
>
> However, when I try to submit data from this form I get:
>
> "Key 'date_from' not found in "
>
> Basically telling me there's no post data.
>
> Can anyone let me know what I'm missing. I have the trailing slash,
> and I've also tried removing the URL altogether and posting to "" and
> then picking up on it there, but no dice...
>
> Thanks for any help.
>
> Tom


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



Re: No POST data

2007-05-03 Thread tomass

Turns out it was the "disabled" directive in the form. Weird, as I'm
pretty sure it works on other forms in other applications, but when I
remove it, it works great.

On May 3, 11:36 am, tomass <[EMAIL PROTECTED]> wrote:
> I realise this is likely something trivial I am missing, and I'm aware
> ofhttp://code.djangoproject.com/wiki/NewbieMistakes...
>
> However, I have a form that's set up like this:
>
> From:  disabled id="date_from" name="date_from" value="04/25/2007" size="10"
> maxlength="12" readonly="readonly" />Calendar.setup({ inputField : "date_from", button :
> "date_from_cal" }); To:  name="date_to" value="04/28/2007" size="10" maxlength="12"
> readonly="readonly" /> id="date_to_cal" style="cursor: pointer; vertical-align: top !
> important;" />Calendar.setup({ inputField : "date_to", button :
> "date_to_cal" });  (Oldest Log: Wed, 25 Apr 2007 09:12:26 +2000, Newest Log Fri,
> 27 Apr 2007 10:31:56 +2000)
>
> my urls.py looks like this:
>
> urlpatterns += patterns('monitor.zopelog.views',
> (r'^landscape/logs/$', 'index'),
> (r'^landscape/logs/(?P\d{8})/(?P\d{8})/$',
> 'index'),
> (r'^landscape/logs/daterange/$', 'parsedate'),
> )
>
> and here's my parsedate function:
>
> def parsedate(request):
>
> date_from = request.POST['date_from']
> date_from = date_from.split('/')
> date_to = "%s%s%s" % (date_from[2], date_from[0],
> date_from[1])
>
> date_to = request.POST['date_to']
> date_to = date_to.split('/')
> date_to = "%s%s%s" % (date_to[2], date_to[0], date_to[1])
>
> return HttpResponseRedirect('/landscape/logs/%s/%s/' %
> (date_from, date_to))
>
> However, when I try to submit data from this form I get:
>
> "Key 'date_from' not found in "
>
> Basically telling me there's no post data.
>
> Can anyone let me know what I'm missing. I have the trailing slash,
> and I've also tried removing the URL altogether and posting to "" and
> then picking up on it there, but no dice...
>
> Thanks for any help.
>
> Tom


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



Re: No POST data

2007-05-03 Thread Jeremy Dunck

On 5/3/07, tomass <[EMAIL PROTECTED]> wrote:
...
> return HttpResponseRedirect('/landscape/logs/%s/%s/' %
> (date_from, date_to))

Are you certain 'index' isn't trying to use request.POST?

You're redirecting there in 'parsedate'.

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



No POST data

2007-05-03 Thread tomass

I realise this is likely something trivial I am missing, and I'm aware
of http://code.djangoproject.com/wiki/NewbieMistakes...

However, I have a form that's set up like this:

From: Calendar.setup({ inputField : "date_from", button :
"date_from_cal" }); To: Calendar.setup({ inputField : "date_to", button :
"date_to_cal" });  (Oldest Log: Wed, 25 Apr 2007 09:12:26 +2000, Newest Log Fri,
27 Apr 2007 10:31:56 +2000)

my urls.py looks like this:

urlpatterns += patterns('monitor.zopelog.views',
(r'^landscape/logs/$', 'index'),
(r'^landscape/logs/(?P\d{8})/(?P\d{8})/$',
'index'),
(r'^landscape/logs/daterange/$', 'parsedate'),
)

and here's my parsedate function:

def parsedate(request):

date_from = request.POST['date_from']
date_from = date_from.split('/')
date_to = "%s%s%s" % (date_from[2], date_from[0],
date_from[1])

date_to = request.POST['date_to']
date_to = date_to.split('/')
date_to = "%s%s%s" % (date_to[2], date_to[0], date_to[1])

return HttpResponseRedirect('/landscape/logs/%s/%s/' %
(date_from, date_to))

However, when I try to submit data from this form I get:

"Key 'date_from' not found in "

Basically telling me there's no post data.

Can anyone let me know what I'm missing. I have the trailing slash,
and I've also tried removing the URL altogether and posting to "" and
then picking up on it there, but no dice...

Thanks for any help.

Tom


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