Re: checkbox, how to return state back to html
On 2011-02-03, at 4:46 AM, gintare wrote: > 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 a...@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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
checkbox, how to return state back to html
views.py "if statements" recognize that the box was checked. I am not able to return the checkbox state back to web.html I would like to see the last checkbox choices in my page. web.html views.py def xxx(request): cbSMWord = request.POST.get('cbSMWord ','') if (cbSMWord): print 'view recognized that checkbox was checked' #this works print 'cbSMWord=', cbSMWord #this gives empty string, why? return render_to_response('c:/Python27/Scripts/Spokas/web.html', {'cbSMWord':cbSMWord}, context_instance = RequestContext(request) ) -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.