I have a non-admin form in which I\'d like to use filter_horizontal on. I have read this which does much more than what I want (I only want the filter_horizontal). I wanted
I know this thread is old, but hopefully this info will help someone else who stumbles upon this page like I did.
After much pain and suffering, I was able to get this to work with Django 1.4. Like rh0dium, I tried all those articles, but had to make a lot of tweaks.
You don't have to do anything special with the ModelForm, but you do have to include all these js and css files in the template:
Then render the form as you normally would, but you need to get the fieldset elements and class names right for the css to work. For example:
Then at the BOTTOM of the template (after the markup to render the form), add this script and replace pricetags with whatever your Many to Many (M2M) relationship name is on the model form's model:
Apparently your media location may be something different, but {{ STATIC_URL }}admin/ worked for me.