python - Django dropdown only using the django widget form passing selected item -


hi want create dropdown menu django forms. know default using select widget.

class privacyform(forms.form):     visibility =forms.choicefield(required=true,choices=posts.post_privacy_choices, initial=1)      post_privacy_choices = (       (1, 'public'),       ('ofo', 'only followers'),       ('om', 'only me'),  )   

ok normal dropdown choices. when change dropdown me or followers want call function given selected argument , preferable function in views.py , want choice saved not default. know there

widget=forms.select(attrs={"onchange":'refresh()') 

, dont find in django docs , not seem work. hope can me.


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

php - Improving script execution time -

How to provide Authorization & Authentication using Asp.net, C#? -