Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable autocomplete in django-crispy-forms PrendedText Field

I am using django-crispy-forms and wondering how to disable autocomplete for a specific field. The field is a forms.IntegerField that is prependedtext.

p_number = forms.IntegerField()

helper = FormHelper()
helper.form_class = 'form-horizontal'

helper.layout = Layout(
    Row(
        PrependedText('p_number', 'P',css_class='input-xlarge'),
        Submit('submit','Submit', css_class='btn-primary'),
    )
)
like image 414
Bot Avatar asked Dec 12 '22 17:12

Bot


1 Answers

The crispy-forms way of doing this would be as easy as:

PrependedText('p_number', 'P', css_class='input-xlarge', autocomplete="off"),
like image 92
maraujop Avatar answered Dec 22 '22 15:12

maraujop