Thursday, February 3, 2011

Re: checkbox, how to return state back to html

On 2011-02-03, at 4:46 AM, gintare wrote:
> <input type="checkbox" value="checkbox" name=cbSMWord >

You don't have " around cbSMWord so the full variable name is 'cbSMWord'.

> cbSMWord = request.POST.get('cbSMWord ','')

You have a space on the end of the variable here. 'cbSMWord ' is not equal to 'cbSMWord'

> return render_to_response('c:/Python27/Scripts/Spokas/web.html',
> {'cbSMWord':cbSMWord}, context_instance = RequestContext(request) )

Also, you should not be specifying the full path to templates, let the template loader do that for you.
--
Andy McKay
andy@clearwind.ca
twitter: @andymckay

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment