Hi,

I am having some issues with making my form/model fields not required. 
Currently this is the code that I have:

forms.py:

class startRound(forms.ModelForm):
player_2 = forms.CharField(widget=forms.TextInput(attrs={'disabled':'True', 
'hidden':'True', 'id':'player_2'}))
player_3 = forms.CharField(widget=forms.TextInput(attrs={'disabled':'True', 
'hidden':'True', 'id':'player_3'}))
player_4 = forms.CharField(widget=forms.TextInput(attrs={'disabled':'True', 
'hidden':'True', 'id':'player_4'}))
class Meta:
model = parentRounds

models.py
class parentRounds(models.Model):
Name = models.CharField(max_length=200)
player_1 = models.CharField(max_length=25)
player_2 = models.CharField(max_length=25, null=True, blank=True)
player_3 = models.CharField(max_length=25, null=True, blank=True)
player_4 = models.CharField(max_length=25, null=True, blank=True)
started_on = models.DateTimeField(auto_now_add=True)
completed = models.BooleanField(default = False)

The template is just the generic {{ form.player_1 }} with some jquery to 
hide/show player 2,3,4 depending on the select box value for number of 
players. Before I started adding jquery code to the template, this worked 
fine.

Any ideas what could have happened?!

Thanks in advance!
Brendan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/739d4756-c09b-45df-9173-627db8ebc839%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to