Re: Form hidden filed for foreign key - validation error

2011-05-06 Thread Boris Tomic
I am outputting the field but I am using javascript to populate its value attribute. Maybe there is some difference from default behavior for empty value. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dja

Re: Form hidden filed for foreign key - validation error

2011-05-06 Thread Tom Evans
On Tue, May 3, 2011 at 11:16 PM, Boris Tomic wrote: > I have added (required=False) to field: >> contactid = ModelChoiceField(queryset=Contact.objects.all(), >> widget=HiddenInput()) >> > > so now I have: > contactid = ModelChoiceField(queryset=Contact.objects.all(), > widget=HiddenInput(), requir

Re: Form hidden filed for foreign key - validation error

2011-05-03 Thread Boris Tomic
I have added (required=False) to field: > contactid = ModelChoiceField(queryset=Contact.objects.all(), > widget=HiddenInput()) > so now I have: contactid = ModelChoiceField(queryset=Contact.objects.all(), widget=HiddenInput(), required=False) and it seems to be working. To me this looks as bug bu

Form hidden filed for foreign key - validation error

2011-05-03 Thread Boris Tomic
I want to have foreign key in form displayed as hidden field. I will be using javascript to populate this field. Model is defined as: contactid = models.ForeignKey(Contact, blank = True, null = True, on_delete = models.PROTECT) I tried to define form field as: contactid = ModelChoiceField(query