Dynamically Build Ajax Dropdown Resets To Original State When Trying To Save With Django Form?
I my form I have few dropdowns chained between them with AJAX. This is how I a populating them function getleaseterm() { //get a reference to the select element
Solution 1:
I have figured out what was the problem it is in my form file
If I keep the lease and leaseterm fields just in Meta class that it doesn't reset those fields on submit any more . And all my logic finally works as designed.
classMassPaymentForm(forms.ModelForm):
classMeta:
model = LeasePaymentfields= ['lease', 'leaseterm', 'payment_type', 'is_deposit', 'amount', 'method', 'payment_date', 'description']
Post a Comment for "Dynamically Build Ajax Dropdown Resets To Original State When Trying To Save With Django Form?"