Remove individual label from django crispy form layout
See original GitHub issue self.helper = FormHelper()
self.helper.form_method = 'POST'
self.helper.form_class = 'form-horizontal'
#self.helper.form_show_labels = False
self.helper.show_label_first_name = False
self.helper.layout = Layout(
Div(
Div(HTML("""<label> Trust Admin Name</label>""")),
Div(Field('first_name',label="", placeholder="First Name"), css_class='span3'),
Div(Field('middle_name', label="", placeholder="middle Name"), css_class='span3'),
Div(Field('last_name', label="", placeholder="last Name"), css_class='span3'),
),
Div(
Div(Field('mobile_number', placeholder= "Mobile Number"), css_class='span6'),
Div(Field('landline_number',placeholder="Landline Number"), css_class='span6'),
),
Div(
Div(Field('email', placeholder="Email Address"), css_class='span6'),
Div('', css_class='span6'),
),
)
super(TrustAdministrationForm, self).__init__(*args, **kwargs)
I want to remove the “first_name”, “middle_name” and “last_name” from form layout, How ca i do this.
Issue Analytics
- State:
- Created 10 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Remove Labels in a Django Crispy Forms - Stack Overflow
The solution below lets you remove a label from both a regular or crispy control. Not only does the label text ...
Read more >Removing labels from dynamic django crispy formset
I have taken your advice and switched to using a helper, and have been able to remove the labels using form_show_labels = False...
Read more >Layouts — django-crispy-forms 1.14.0 documentation
Django -crispy-forms defines another powerful class called Layout , which allows you to change the way the form fields are rendered.
Read more >django-crispy-forms Documentation - Read the Docs
These are layout objects that are not specific to a template pack. We'll go one by one, showing usage examples: • Div: It...
Read more >Django Tutorial Part 9: Working with forms - MDN Web Docs
The Form class is the heart of Django's form handling system. It specifies the fields in the form, their layout, display widgets, labels, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In case you (or someone else) hasn’t figured out how to do this:
@notanumber, thanks it’s working for us. 👍