-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 That needs to be : alert({{ selectedAreas.BC }});
Look at the documentation. This problem is fairly obvious if you do: http://docs.djangoproject.com/en/dev/topics/templates/#variables I'm not trying to be mean, but please look at the docs before you post here, it wastes our time, and yours waiting for a response. Thanks! We are more than happy to help, just please check the documentation first. ;) Hope that works for you. Luke Seelenbinder luke.seelenbin...@gmail.com On Sat, Aug 8, 2009 at 5:32 PM, WilsonOfCanada wrote: -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkp+Nf4ACgkQXQrGVCncjPy+0QCeJApu38xtnpmR9lEg4XgMrXaK fQEAoIo0vbiYDVLkHLnTMZb5SlpnpELT =QOCH -----END PGP SIGNATURE----- > > I sent the variable as dictionary with lists > {'BC:['Vancouver', 'Kamloops'], AB:['Calgary']} > > However, when I use the variable in the function, it is treated as a > string. > > function changeArea(mooman) > { > alert(selectedAreas["BC"]); > } > > This was not defined. Is there something more I need to add to the > onchange="changeArea('{{ mooman|safe|escape}}');? > > Thanks > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---