The Javascript Function does not seem to be executed. In admin_form.html :
{% extends "admin/change_form.html" %} {% block extrahead %} <script src="http://127.0.0.1/django-medias/chantier/js/ jquery-1.2.3.js" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> $(function(){ $("select#id_categorie").change(function(){ $.getJSON("/admin/boutique/produit/getsubcategory/",{id: $ (this).val()}, function(d){ alert("here") var options = '<option value="">---------</option>'; for (var i = 0; i < j.length; i++) { options += '<option value="' + j[i].id + '">' + j[i].nom + '</option>'; } $("select#id_sous_categorie").html(options); }) alert("there") }) }) </script> {% endblock %} The only alert I've got is [[there]] and never [[here]]. All seems to be fine except this... An idea ? On 8 mai, 15:22, martyn <[EMAIL PROTECTED]> wrote: > That's it ! > I'm discovering JQuery, not very "sexy" for the first time, but seems > to be really powerfull. > > Thank you Diego. > Django community really rocks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---