0

I was using a default value in the model

constitucional_64 = models.CharField(max_length=500, null=True,blank=True,default='negado')

The problem is the I need to delete the value from the input when I click on it, I'm using placeholders in my ModelForm

class ExpedienteInicialform(ModelForm):
  class Meta:
    model = ExpedienteConsultaInicial
    widgets = {
        'constitucional_64': forms.TextInput(attrs={'placeholder': 'negado'}),
    }

But I need to get the value 'negado' to send the to the database, the placeholder works fine, the problem is that I don't get the value in the POST.

GioBot
  • 613
  • 5
  • 10
  • 17
  • possible duplicate of [Django set default form values](http://stackoverflow.com/questions/604266/django-set-default-form-values) – dm03514 Mar 19 '14 at 16:03

1 Answers1

0

Instead of placeholder, use value.

'constitucional_64': forms.TextInput(attrs={'value': 'negado'}),
xyres
  • 20,487
  • 3
  • 56
  • 85