-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support to not displaying labels for form inputs #47
Comments
You can control this simply with the CSS below: <style>
.form-control-label { display: none; }
</style> |
I'd need to set this separately for each text area, so looking for a way to do this directly from Python when creating the particular field or from Python for all fields that do not have a label as to minimize using CSS. |
@greyli Any new thoughts on how to support this from Python? |
For Bootstrap 5 it is:
At the moment in
Proposal to extend with:
This keeps the current behaviour and only extends it. Benefit is that all can be achieved without using custom CSS. |
This would involve overriding https://github.com/wtforms/wtforms/blob/master/src/wtforms/fields/core.py#L446 so it returns an empty string. I'm not sure if we would like to do this or how we can do this. Any ideas? @greyli |
If we cannot accommodate a solution, would it be a feature request for wtforms? |
Would this also be a feature request for wtforms? https://github.com/greyli/bootstrap-flask/blob/master/flask_bootstrap/__init__.py#L9 |
Setting |
When a WTForms field has no label, a label is generated from the variable name it is assigned to, e.g. for a
TextAreaWidget
. This is very useful (convention over configuration).However, in certain cases, the label of an input is not added to thre resulting HTML. What parameter can be used when creating a WTForm field in order to extend the form template here to not add the label around an input?
This relates to:
The text was updated successfully, but these errors were encountered: