Ali Raza
Ali Raza

Reputation: 1073

show only input in django_crispy_from?

How to show only the input field in Django crispy form.

<div class="">
     {{form1.username|as_crispy_field}}
</div>

enter image description here

how can it only show input field

Upvotes: 0

Views: 373

Answers (1)

AzyCrw4282
AzyCrw4282

Reputation: 7744

If you want to remove labels from certain fields then you can do so by adding this to the Class responsible for your form.

self.fields['some_field'].label = False

Where some_field is the name of the field whose label you want to remove.

You can also see the answers here for different solutions to this problem.

Upvotes: 1

Related Questions