[Answered ]-Dynamic forms in django with ajax/dajax


You need to add your dajaxice function to the select onchange to reference your function in the template.

Something like:

<select name="combo2" id="combo2" onchange="Dajaxice.your_project.your_appname.updatefilter(Dajax.process,{'option':this.value}" size="1"></select>

(Replace your_project with your project name, your_app with your appname).

Also make sure in your template you have all the necessary headers (and that they actually are there; e.g., if you view the source that you can click to them).

Be sure to debug using google chrome inspector (Ctrl-Shift-I) or firebug (in firefox).

EDIT: I now noticed that you have something similar that’s in your form. How does it render in the HTML when you view the source? Is it improperly escaped?


I think you forgot a % sign (value='#') and a closing </option> in here:

out = "%s<option value='%s'>%s</option>" % (out,o,o)


Leave a comment