I have a Django form with several fields in it one of which needs to be repeated n times (where n is not known at design time) how would I go about coding this (if it is possible at all)?
e.g. instead of :-
Class PaymentsForm(forms.form):
invoice = forms.CharField(widget=ValueHiddenInput())
total = forms.CharField(widget=ValueHiddenInput())
item_name_1 = forms.CharField(widget=ValueHiddenInput())
item_name_2 = forms.CharField(widget=ValueHiddenInput())
.
.
.
item_name_n = forms.CharField(widget=ValueHiddenInput())
I need something like :-
Class PaymentsForm(forms.form):
invoice = forms.CharField(widget=ValueHiddenInput())
total = forms.CharField(widget=ValueHiddenInput())
item_name[n] = forms.CharField(widget=ValueHiddenInput())
Thanks,
Richard.