siddharth ghumre
unread,Dec 11, 2012, 6:39:48 AM12/11/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hi,
I am facing problem in handling modelform and ajax together.
The situation is:-
I am using modelform to get display the form as ul in the template.
I have 3 ChoiceFields (country, state,city). On select of a country
from the dropdown, the valid states dropdown gets populated and on
select of a state the respective city dropdown gets populated.
For achieving the above functionality I am calling an ajax function
which returns me the available data of the other dropdown in Json Form
{stat_id, stat_name}
I am able to populate the data in next dropdown i.e state and city,
but when i click submit form it shows "Select a valid choice. 8 is not
one of the available choices"
8 happens to be the stat_id in this case.
I have gone through google but dint find anything useful. Help is
really appreciated.